Memory system and method of data writing and reading in memory systems

ABSTRACT

A memory system according to the embodiment comprises a p-adic number converter unit operative to convert δ-digit, h-bit symbols to a k-digit, p-adic data word (p is a prime of 3 or more); an encoder unit operative to generate, from the p-adic data word, a code C composed of a residual field Zp of the prime p; a memory unit operative to store the code C as write data; an error correcting unit operative to apply an operation using a syndrome S generated from read data Y for error correcting the read data Y to regenerate the code C; a decoder unit operative to reverse-convert the code C to regenerate the p-adic data word; and a binary converter unit operative to convert the data word to a binary number to regenerate the binary data D.

CROSS-REFERENCE TO RELATED APPLICATION

This application is based upon and claims the benefit of priority from the prior Japanese Patent Application No. 2010-66440, filed on Mar. 23, 2010, the entire contents of which are incorporated herein by reference.

FIELD

The embodiment relates to a memory system and a method of data writing and reading in memory systems.

BACKGROUND

As memory systems have higher capacities, fine fabrications of memory cells, increases in the number of storage bits per cell, and achievements of memory cell arrays with three-dimensional structures have been developed. In a memory system, however, the larger the capacity, the easier the errors occur in stored data. Thus, many memory systems with an on-chip ECC (Error Correcting Code) system have been proposed (for example, Patent Document 1: JP 2009-181439A). The ECC system treats random bit errors (hereinafter simply referred to as “random errors”). In this case, it can support such random bit errors that arise in data writing and so forth. In high-density, three-dimensionally structured memory cells, in addition to such random bit errors, bit errors may arise intensively in a certain region (hereinafter referred to as “burst errors”) due to defects caused on production. The above-described ECC system cannot support such burst errors. Several other on-chip ECC systems have been proposed (Patent Document 2: WO 2008-099723, for example). It is difficult, though, to say that these on-chip ECC systems can support both random errors and burst errors sufficiently.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram of a memory system according to a first embodiment.

FIG. 2 is a diagram showing a flow of data writing in the present memory system.

FIG. 3A is a diagram showing a flow of data reading in the present memory system.

FIG. 3B is a diagram showing a flow of data reading in the present memory system.

FIG. 4A is a diagram illustrative of an outline of conversion from data to a code in the present memory system.

FIG. 4B is a diagram illustrative of an outline of conversion from data to a code in the present memory system.

FIG. 5 is a diagram showing a relation between a bit error and a symbol in the present memory system.

FIG. 6 is a diagram showing relations between levels and symbol values when one symbol is recorded in 2 multi-level cells in the present memory system.

FIG. 7 is a diagram showing errors caused when one symbol is recorded in 2 multi-level memory cells in the present memory system.

FIG. 8A is a diagram showing errors caused when one symbol is recorded in 2 multi-level memory cells in the present memory system.

FIG. 8B is a diagram showing errors caused when one symbol is recorded in 2 multi-level memory cells in the present memory system.

FIG. 9A is a diagram showing errors caused when one symbol is recorded in 2 multi-level memory cells in the present memory system.

FIG. 9B is a diagram showing errors caused when one symbol is recorded in 2 multi-level memory cells in the present memory system.

FIG. 10A is a diagram showing errors caused when one symbol is recorded in 2 multi-level memory cells in the present memory system.

FIG. 10B is a diagram showing errors caused when one symbol is recorded in 2 multi-level memory cells in the present memory system.

FIG. 11A is a diagram showing errors caused when one symbol is recorded in 2 multi-level memory cells in the present memory system.

FIG. 11B is a diagram showing errors caused when one symbol is recorded in 2 multi-level memory cells in the present memory system.

FIG. 12A is a diagram showing a rule for recording a symbol having the maximum value when one symbol is recorded in 2 multi-level memory cells in the present memory system.

FIG. 12B is a diagram showing a rule for recording a symbol having the minimum value when one symbol is recorded in 2 multi-level memory cells in the present memory system.

FIG. 13A is a diagram showing errors caused when one symbol is recorded in 2 multi-level cells in the present memory system.

FIG. 13B is a diagram showing errors caused when one symbol is recorded in 2 multi-level memory cells in the present memory system.

FIG. 14A is a diagram showing errors caused when one symbol is recorded in 2 multi-level memory cells in the present memory system.

FIG. 14B is a diagram showing errors caused when one symbol is recorded in 2 multi-level memory cells in the present memory system.

FIG. 15A is a diagram showing errors caused when one symbol is recorded in 2 multi-level memory cells in the present memory system.

FIG. 15B is a diagram showing errors caused when one symbol is recorded in 2 multi-level memory cells in the present memory system.

FIG. 16 is a diagram showing a relation between the number of levels, the redundancy and so forth of memory cells in the present memory system.

FIG. 17 is a diagram showing a relation among the unit of processing, the redundancy and so forth in a memory system capable of correcting 2-symbol errors according to a second embodiment.

FIG. 18 is a diagram showing a relation among the unit of processing, the redundancy and so forth in the present memory system capable of correcting 3-symbol errors.

FIG. 19 is a diagram showing a relation among the unit of processing, the redundancy and so forth in a memory system capable of correcting 4-symbol errors according to a second embodiment.

FIG. 20 is a diagram showing a relation among the unit of processing, the redundancy and so forth in the present memory system capable of correcting 6-symbol errors.

FIG. 21 is a diagram showing a relation among the unit of processing, the redundancy and so forth in the present memory system capable of correcting 7-symbol errors.

FIG. 22 is a diagram showing a relation among the unit of processing, the redundancy and so forth in the present memory system capable of correcting 8-symbol errors.

FIG. 23 is a diagram for comparing the error correcting ability of the ECC system on the memory system according to the embodiment with those of other ECC systems.

DETAILED DESCRIPTION

A memory system according to the embodiment comprises a p-adic number converter unit operative to divide batch-processed binary data D into δ-digit (δ is an integer), h-bit (h is an integer) symbols and convert the symbols to a k-digit (k is an integer), p-adic data word (p is a prime of 3 or more); an encoder unit operative to generate, from the data word p-adic converted at the p-adic number converter unit, a code C composed of a residual field Zp of the prime p, of n-digit (n=p−1) code words having numbers on digits each indicated by h bits; a memory unit operative to store the code C of Zp generated at the encoder unit as write data; an error correcting unit operative to generate, from read data Y read out from the memory unit, a syndrome S and apply an operation using the generated syndrome S for error correcting the read data Y to regenerate the code C of Zp; a decoder unit operative to reverse-convert the code C of Zp regenerated at the error correcting unit to regenerate the p-adic data word; and a binary converter unit operative to convert the data word regenerated at the decoder unit to a binary number to regenerate the binary data D.

The following description is given to memory systems and methods of data writing and reading in memory systems according to the embodiments with reference to the drawings.

[First Embodiment]

A first embodiment is described below.

Higher capacities of memory systems may require fine fabrications of memory cells, memory cell arrays with three-dimensional structures, and memory cells of the multi-value storage type. In this case, defects caused in the memory systems are various.

For example, if there are defects in the structures of memory cells and so forth, the defects hardly arise in a certain memory cell restrictively. Instead, the defects arise intensively in plural memory cells within a certain range. On the other hand, if the operations of memory cells become unstable, the defects distribute over a wide range. Therefore, such the memory system requires an ECC system capable of checking and correcting both burst errors and random errors.

With this regard, the conventional ECC system (hereinafter referred to as “RS-ECC system”) in accordance with the Reed-Solomon code (hereinafter referred to as “RS code”) is difficult to check and correct a variety of random errors even if it can check and correct burst errors.

In addition to the RS-ECC system, there is another ECC system in accordance with a BCH code using GF(2^(n)) that is a Galois field on the basis of a power of 2 (hereinafter referred to as “2^(n)-BCH-ECC system”). The BCH-ECC system can check and correct both burst errors and random errors. An ECC process requires an addition of a redundant bit on data coding and thus it needs an extra process of at least 1 bit more than actual data. Namely, treatment of 2^(n)-bit data uses GF(2^(n+1)). This means that it requires an operation of data by double the amount of actual data. Particularly, in a mass-storage memory system with increasingly larger batch-handled data, the computational complexity becomes enormous and accordingly enlarges the circuit scale and extends the processing time.

The present embodiment proposes an ECC system in accordance with a Lee Metric Code using GF(p) that is a Galois field on the basis of a prime p, that is, an irreducible residue class Zp (hereinafter referred to as “p-LM-ECC system”) as an alternative ECC system to the 2^(n)-BCH-ECC system. The p-LM-ECC system is operative to symbolize data and correct errors in symbols and, in that sense, applies a scheme close to the RS-ECC system. The following description is given to a p-LM-ECC system capable of correcting 2 random symbol errors as a specific example.

While taking up the problems again in the case of the use of GF(2^(n)), the directionality of construction of the p-LM-ECC system according to the present embodiment is described. The problems described herein include one on a 2^(n)-BCH-ECC system for general processing and one on an ECC system in accordance with the RS code using GF(2^(n)) to realize fast processing for on-chip (hereinafter referred to as “2^(n)-RS-ECC system”).

These 2 ECC systems are common in the process of generating a syndrome for an error but different in the way of processing the syndrome.

The processing of the syndrome is divided into 2 steps: the first step of constructing a solution searching polynomial Λ(x); and the second step of searching a root of Λ(x)=0.

The 2^(n)-BCH-ECC system seeks a solution searching polynomial Λ(x) that can satisfy a series of condition expressions called “key”, in the first step, using an iterative method based on the quantity obtained from the syndrome. Available iterative methods include established algorisms such as a Euclid method and a BM (Berlekamp-Massey) method. In the subsequent second step, each element in the Galois field used in the solution searching polynomial Λ(x) is substituted sequentially to seek an element that satisfies Λ(x)=0. This algorism is established as a Chien Search method. Thus, in the case of the 2^(n)-BCH-ECC system, the first step needs the time for iterations until the solution searching polynomial Λ(x) is obtained though it requires no enormous time.

Therefore, it can be realized with the iterative use of a small scale circuit. On the other hand, the second step can be realized with a small scale circuit though it requires an enormous processing time for scanning all elements in the Galois field. As above, in the 2^(n)-BCH-ECC system, when batch-processed data is large, the processing time at the second step becomes a bottleneck and cannot realize real-time data access.

The 2^(n)-RS-ECC system directly seeks coefficients of a solution searching polynomial Λ(x), in the first step, using no iterative method. Therefore, the circuit scale becomes large though the processing time for obtaining the solution searching polynomial Λ(x) can be made shorter. Further, in the second step, elements in the Galois field that can satisfy Λ(x)=0 are sought previously at a decoder to seek a solution through matching-by-decoder. Therefore, fast processing can be achieved independent of the number of elements in the Galois field. The circuit scale of the decoder becomes large in proportion to the number of elements in the Galois field and accordingly the circuit scale becomes enormous. As above, the 2^(n)-RS-ECC system that realizes fast processing for on-chip has a larger circuit scale and therefore it is difficult to be used in those other than the special purpose memory systems that have priority to the processing speed.

In consideration of the above problems, an improved one is a lately-proposed p-LM-ECC system. The p-LM-ECC system can check and correct both burst errors and random errors, and further realizes a circuit scale and processing speed that can bear as an on-chip ECC system.

[Outline of Memory System]

An outline of a memory system according to the present embodiment is described herein.

FIG. 1 is a block diagram of the present memory system. FIG. 2 is a diagram showing a flow of data writing in the present memory system. FIGS. 3A and 3B are diagrams showing data reading in the present memory system.

The present memory system comprises a memory unit 100 and an ECC system 200 as roughly divided.

The memory unit 100 is a mass-storage memory such as a flash memory, a PRAM and a ReRAM. The ECC system 200 includes a p-adic number converter unit 201 and an encoder unit 202 on the data writing side to the memory unit 100. It also includes an error correcting unit (203-206), a decoder unit 207 and a binary converter unit 208 on the data reading side from the memory unit 100. The error correcting unit (203-206) contains a syndrome generator unit 203, a solution searching polynomial generator unit 204, a Hasse differential polynomial generator unit 205 and a code restorer unit 206. The ECC system 200 may be mounted on the same chip as the memory unit 100 or provided on a different chip from the memory unit 100.

Writing data to such the memory system can be performed as follows. First, data D fed from external is divided at every h bits in the p-adic number converter unit 201 to convert it to a 2^(h)-adic expression (h is an integer) (S1 in FIG. 2) and then convert it to a p-adic expressed data word D(h) (p is a prime of 3 or more) (S2 in FIG. 2).

Subsequently, the encoder unit 202 applies a generator matrix G to the data word D(h) to generate a Lee metric code C (S3 in FIG. 2).

Finally, the Lee metric code C is recorded and held in the memory unit 100 (S4 in FIG. 2).

Reading data is performed as follows. First, an error containing code Y is read out of the memory unit 100 (S5 in FIG. 3A). The syndrome generator unit 203 applies a syndrome matrix H to the read code Y to generate a syndrome S (S6 in FIG. 3A).

Subsequently, the solution searching polynomial generator unit 204 seeks coefficients of a solution searching polynomial Ψ(x) from the syndrome S to generate the solution searching polynomial Ψ(x) (S7 in FIG. 3A).

Then, if the coefficients of the solution searching polynomial Ψ(x) satisfy a certain condition (S8 in FIG. 3A), the Hasse differential polynomial generator unit 205 generates a Hasse differential polynomial [Ψ(x)]^([i]) for seeking a solution (S9 in FIG. 3A) to compute a root r thereof and the multiplicity n of the root (S10 in FIG. 3B).

Subsequently, the code restorer unit 206 uses the computed root r and the multiplicity n of the root to calculate the position of the error contained in the code Y and the error quantity to restore the code C (S11 in FIG. 3B).

Then, the decoder unit 207 reverse-converts the generator matrix G over the restored code C to regenerate the p-adic expressed data word D(h) (S12 in FIG. 3B).

Finally, the binary converter unit 208 converts the p-adic expressed data word D(h) to a 2^(h)-adic expression and then provides it to external as binary data D (S13 in FIG. 3B).

The above steps of processing are described below in detail.

[Conversion to Code C]

The following description is given to the principle of conversion from the data D, which is fed from external, to the code C, which is to be recorded to the memory unit 100.

First, the necessity of the method of converting from the data D to the code C is described.

In the case of the use of GF(p), a prime p cannot be expressed with a power of 2. Therefore, different from the case of the use of GF(2^(n)), all the bit patterns of the data D cannot be used as the code C as they are. Then, a conversion is required to assign the bit patterns of the data D to the elements of GF(p) one by one.

The elements of GF(p) are integers from 0 to p−1, all of which can be expressed with h-bit binaries. In this case, all bit patterns of h bits are not used. Therefore, h bits of the data D cannot be handled as the elements of GF(p) as they are.

As shown in FIG. 4A, when a set of data D given to the memory system is divided at every h bits (hereinafter a group of data at every h bits is referred to as a “data word symbol”), it can be viewed as an arrangement of n groups, that is, 2^(h)-adic expressed, n-digit data D=(d₁, d₂, . . . , d_(n)). In this case, a bit pattern within a range below 2^(h)−1 of all bit patterns of h bits appears on each digit. On the other hand, as shown in FIG. 4B, an n-word length GF(p) code C=(c₁, c₂, . . . , c_(n)) has a relation between the h-bit and the prime p that establishes c_(j)<p<2^(h). Accordingly, all bit patterns of h bits cannot appear.

Then, the conversion for assigning the data D to the code C one by one is required and it corresponds to a conversion from a 2^(h)-adic expression to a p-adic expression.

The following description is given to a method of selecting a prime p for use in the conversion to a p-adic expression.

The number of bits of the data D batch-processed in the ECC system is expressed with M=δh. When the M-bit data D is converted to a δ-digit 2^(h)-adic expression, it can be viewed as one data word D(h) as shown in Expression 1. D(h)=d _(δ−1)(2^(h))^(δ−1) +d _(δ−2)(2^(h))^(δ−2) + . . . +d ₁(2^(h))¹ +d ₀(2^(h))⁰ 0<d_(δ−1)<2^(h), 0≦d_(j)<2^(h)  [Expression 1] Here, d_(δ−1), d_(δ−2), . . . , d₁, d⁰ denote values of 2^(h)-adic expressions expressed by data word symbols (hereinafter a value expressed by a symbol is referred to as a “symbol value”). Take note that the symbol value d_(δ−1) on the highest digit δ−1 is a non-zero value.

Subsequently, the next condition on the p-adic conversion is set. Namely, when the maximum value and the minimum value in the numbers expressed with the data word D(h) are converted from h-bit binary expressions to p-adic expressions, the increase in the number of digits is limited to 1 digit at the maximum, as (δ+1) digits. Therefore, the p-adic expressed data word D(h) turns to (δ+1)-digit data shown in Expression 2. D(h)=a _(δ)(p)^(δ) +a _(δ−1)(p)^(δ−1) + . . . +a ₁(p)¹ +a ₀(p)⁰ 0≦a_(j)<p, a_(δ)+a_(δ−1)≠0  [Expression 2] Here, a_(δ), a_(δ−1), . . . , a₁, a₀ denote binary expressed symbol values. The symbol values a_(δ) and a_(δ−1) on the highest digit δ and the next digit δ−1 cannot take a zero value at the same time.

Subsequently, a relation between δ and h is sought, which makes it possible to configure the format of the data word D(h) ubiquitously. Namely, a condition is sought, under which a selection of h makes it possible to express 5 digits at the minimum. The minimum value D_(min) (h) and the maximum value D_(max)(h) of the data word D(h) are expressed as in Expression 3. Minimum:D _(min)(h)=(2^(h))^(δ−1) ∵d _(δ−1)=1, d _(j)=0 Maximum:D _(max)(h)=(2^(h))^(δ)−1∵d _(δ−1) =d _(j)=2^(h)−1  [Expression 3] Therefore, D_(min) (h)−1 has (δ−1) digits and accordingly loses the format of the data word D(h). Then, when compared with a group of (h−1) bits, that is, a 2^(h−1)-adic expression, and if D_(min) (h)−1≧D_(max)(h−1) can be established, even the expression of the data word D(h) does not lower the number δ of digits. In a word, the relation between δ and h can be shown in Expression 4. δ≧h∵(2^(h))^(δ−1)−1≧(2^(h−1))^(δ)−1  [Expression 4]

Subsequently, a condition is sought, under which the increase in the number of digits on a p-adic expression becomes 1 digit at the maximum. When the maximum value D_(max)(h) is viewed in relation to a modulus of p^(δ) or p^(δ+1), it is given as Expression 5. D _(max)(h)(mod p ^(δ))≠D _(max)(h)(mod p ^(δ+1))=D _(max)(h)(mod p ^(δ+2))= . . . ∵(p)^(δ)≦(2^(h))^(δ)−1<(p)^(δ+1)  [Expression 5] Here, each side of Expression 5 can be expressed with an integer. Accordingly, it is possible to establish (p)^(δ)<(2^(h))^(δ) and (2^(h))^(δ)≦(p)^(δ+1). Therefore, a prime p falls within a range as shown in Expression 6. (2^(h))^(δ/(δ+1))≦p<2^(h)  [Expression 6] Further, δ/(δ+1)=(1−1/δ)/(1+(1/δ)²)<1−1/δ<1−1/h (h≦δ) and p are primes. Accordingly, one of the conditions for selecting a prime p can be expressed as shown in Expression 7. Here, to the minimum value p^(δ−1) of a δ-digit, p-adic number, p^(δ−1)<(2^(h))^(δ−1)=D_(min) (h) can be established. Therefore, no p-adic number becomes less than (δ−1) digits. 2^(h−1)<p<2^(h)  [Expression 7]

Subsequently, to the condition for selecting a prime p obtained through Expression 7, a condition for realizing a Lee metric code is added.

In the p-adic expression of the data word D(h), the Lee metric code of GF(p) can be used to generate a code C having a condition as shown in Expression 8 over (δ+1) symbol values where n denotes a word length of the code C (namely, C=(c₁, c₂, . . . , c_(n))), which includes a dummy word length K, a data word length k, and the maximum value ε=γ−1 of the sums of Lee metrics of correctable errors. n=p−1, d _(L)(C)≧2γ, k=n−γ, k=κ+δ+1  [Expression 8] Here, d_(L)(C) denotes the minimum Lee distance between code words.

Subsequently, as the data D batch-processed in the ECC system has M bits, the data D can be considered as groups of appropriate h bits and viewed as a δ-digit number so that it can be converted to a (δ+1)- or lower-digit p-adic number. Namely, δ+1 corresponds to the data word length of the Lee metric code. In a word, the Lee metric code cannot be created unless δ+1≦k. Thus, the selection of a prime p is processed while determining the word length κ so as to satisfy δ+1+κ=k and giving a fixed value (for example, 0) to the code word having the word length κ. Accordingly, in relation to δ+1+κ=k and k=p−ε−2, one of the conditions for selecting a prime p is given as Expression 9. δ+ε+3+κ=p, 0≦κ  [Expression 9]

In summary, when the maximum value of the sums of Lee metrics of correctable errors required in the ECC system is E and the data length of the batch-processed data D is M bits, as δh≧M, and δ+ε+3+κ=p (0≦κ), a condition for selecting a prime p is given as Expression 10.

$\begin{matrix} {{p \geq {\frac{M}{h} + ɛ + 3 + \kappa}}{AND}{2^{h - 1} < p < 2^{h}}} & \left\lbrack {{Expression}\mspace{14mu} 10} \right\rbrack \end{matrix}$ Further, the prime p to be selected is one having the minimum dummy word length κ of the primes p that satisfy the condition shown in Expression 10, that is, a prime p that minimizes κ=p−δ−ε−3. For information, δ is the minimum integer more than M/h.

Here, a redundant word length γ as the code C on GF(p) is γ=ε+1=n−k=n−(κ+δ+1). Accordingly, a redundant word length (n−δ) viewed from the number of digits of the data word D(h) becomes n−δ=κ+1+γ. Therefore, a redundant bit length viewed from the data word D(h) is given as Expression 11. h(n−δ)=h(γ+1+κ)  [Expression 11] In a word, a selection of a prime p having the minimum word length K of the primes p that satisfy Expression 10 makes it possible to reduce the redundant word length (n−δ) most.

The following description is given to a method of converting the input data D to a Lee metric code C. Prior to that description, the Lee metric code for use in the present embodiment is described. Hereinafter, each digit contained in the code is referred to as a “code word symbol”.

A code word symbol c is an integer shown in Expression 12. cεGF(p)=Zp, 0≦c<p  [Expression 12] When Lee metrics of these integers are denoted with |c|, and all Lee metrics |c| are represented by integers smaller than p/2, the Lee metrics |c| are defined by Expression 13.

$\begin{matrix} {{{0 \leq c < {\frac{p}{2}\text{:}\mspace{14mu}{c}}} = c}{{\frac{p}{2} < c < {p\text{:}\mspace{14mu}{c}}} = {p - c}}} & \left\lbrack {{Expression}\mspace{14mu} 13} \right\rbrack \end{matrix}$

As the code C can be considered a row of n (=p−1) code word symbols, it can be represented by C=(c₁, c₂, . . . , c_(n)) as shown in FIG. 4B, and a metric w(C) of the code C can be defined as the sum of Lee metrics |c| of the code word symbols as shown in Expression 14. w(C)=|c ₁ |+|c ₂ |+ . . . +|c _(n)|  [Expression 14] The distance between codes is defined by the sum of Lee metrics of differences between the code word symbols corresponding to the code. Here, a difference between 2 codes C and Y (Lee distance) d_(L) (C, Y) is given as Expression 15. d _(L)(C,Y)=w(C−Y)  [Expression 15] Further, the minimum Lee distance of the code C can be defined by the minimum metric of the metrics w(C) of the code C as shown in Expression 16. d _(L)(C)=min w(C)  [Expression 16] Here, the Lee metric code is a code that has the minimum distance of 2γ between codes having a generator matrix G and a syndrome matrix H shown in Expression 17 and that can correct Lee metric errors lower than γ−1.

$\begin{matrix} {{G = \begin{bmatrix} 1 & 2 & \ldots & \left( {p - 1} \right) \\ 1^{2} & 2^{2} & \ldots & \left( {p - 1} \right)^{2} \\ \vdots & \vdots & \ddots & \vdots \\ 1^{k} & 2^{k} & \ldots & \left( {p - 1} \right)^{k} \end{bmatrix}},{H = \begin{bmatrix} 1 & 2 & \ldots & \left( {p - 1} \right) \\ 1^{1} & 2^{1} & \ldots & \left( {p - 1} \right)^{1} \\ \vdots & \vdots & \ddots & \vdots \\ 1^{\gamma - 1} & 2^{\gamma - 1} & \ldots & \left( {p - 1} \right)^{\gamma - 1} \end{bmatrix}}} & \left\lbrack {{Expression}\mspace{14mu} 17} \right\rbrack \end{matrix}$

Here, when the number of symbols in the code C is n and the number of symbols in the data word D is k, then γ=n−k, and γ represents the number of redundant symbols contained in the code C.

The following description is given to a method of encoding the data D fed to the memory system to the Lee metric code C.

First, an M (=δh)-bit binary batch-processed in the ECC system, or data D, is converted to a (δ+1)-digit p-adic expression. At that time, if there is a shortage of κ digits than previously set γ, the κ digits are fixed to 0, for example. The κ-digit numbers thus obtained become elements x of GF(p).

Subsequently, with a data word X (X=(x₁, x₂, . . . , x_(k))), an operation C=XG is executed to obtain the code C.

Finally, code word symbols c_(i) contained in the code C thus obtained are stored in memory cells as binary-expressed h-bit data as shown in Expression 18.

$\begin{matrix} {{{c_{i} = {\alpha_{0}^{i} + {\alpha_{1}^{i} \cdot 2} + \ldots + {\alpha_{h - 1}^{i} \cdot 2^{h - 1}}}},{\alpha_{m}^{i} \in \left( {0,1} \right)}}{c_{i} = {\sum\limits_{j = 1}^{k}\;{(i)^{j}x_{j}}}}} & \left\lbrack {{Expression}\mspace{14mu} 18} \right\rbrack \end{matrix}$ [Error Correction of Code Y]

Here, the principle of error correction for an error-containing code Y is described.

First, prior to the description of error correction for the code Y in the present memory system, a comparison example of error correction is described.

Binary data of the code C recorded in memory cells includes a set of n code word symbols each composed of h bits and causes variations on receipt of various disturbances at every bit. Therefore, a code word symbol c to be stored originally may vary to an unintended code word symbol y. The code C can be restored from the code Y containing the code word symbol y through error correction.

Prior to error correction, it is required to seek a syndrome S.

The code Y containing the varied code word symbol y can be represented as Expression 19. Y=(y ₁ ,y ₂ , . . . , y _(n)) y _(i) =c _(i) +e _(i) , e _(i)=ε₀ ^(i)+ε₁ ^(i)·2+ . . . +ε_(h−1) ^(i)·2^(h−1), ε_(m) ^(i)ε(0,1)  [Expression 19] Here, e_(i) denotes the error quantity in each code word symbol c₁.

The syndrome S can be sought as elements S₀, S₁, . . . , S_(γ−1) shown in Expression 20 through an operation S=YH^(t) using a syndrome matrix H.

$\begin{matrix} {{{\sum\limits_{j = 1}^{p - 1}\;{(j)^{1}c_{j}}} = {{\sum\limits_{i = 0}^{k}\;{x^{i}{\sum\limits_{j = 0}^{p - 1}\;(j)^{1 + i}}}} = {{0\;\therefore\; S_{1}} = {\sum\limits_{j = 1}^{p - 1}\;{(j)^{1}e_{j}}}}}},\;{S_{0} = {\sum e_{j}}}} & \left\lbrack {{Expression}\mspace{14mu} 20} \right\rbrack \end{matrix}$ Here, H^(t) is a transpose of H. The generator matrix G and the syndrome matrix H are configured to satisfy GH^(t)=0 (mod p). Accordingly, a representation of Y=C+E yields S=EH^(t). With E=(e₀, e₁, . . . , e_(n)), a syndrome S₀ is the total sum of errors in the code word symbols as can be found. These syndromes S provide the only information on errors and, on the basis of these syndromes S, the correct code C is restored as follows.

Next, the principle of decoding is described on the assumption that the situation of errors has been identified previously. Here, n(=p−1) error code word symbols are classified into 2 sets J₊ and J⁻ as shown in Expression 21. J ₊ ={j ε(1,2, . . . , n); e _(j) <p/2} J ⁻ ={jε(1,2, . . . , n); e _(j) >p/2}  [Expression 21] Namely, if the error quantity in the error code word symbol is e_(j)<p/2, it is classified into J₊ that is an arrangement of the positions j of the code word symbols c_(j) and J⁻ that is an arrangement of the positions j of the code word symbols c_(j) when the error quantity in the error code word symbol is e_(j)>p/2. Polynomials Λ(x), V(x) on GF(p) are configured on the basis of these sets as Expression 22.

$\begin{matrix} {{{\Lambda(x)} = {\prod\limits_{j \in J_{+}}\;\left( {1 - {jx}} \right)^{e_{j}}}},{{V(x)} = {\prod\limits_{j \in J_{-}}\;\left( {1 - {jx}} \right)^{p - e_{j}}}}} & \left\lbrack {{Expression}\mspace{14mu} 22} \right\rbrack \end{matrix}$ Thus, the polynomial Λ(x) is a polynomial that has a reciprocal number of the position j of an error code word symbol in J₊ as a root and that has a Lee metric e_(j) of that error code word symbol as the multiplicity of the root. On the other hand, the polynomial V(x) is a polynomial that has a reciprocal number of the position j of an error code word symbol in J⁻ as a root and that has a Lee metric p−e_(j) of that error code word symbol as the multiplicity of the root. Decoding is a process of finally configuring these polynomials only from the information on the syndrome S₁ to solve them, thereby obtaining information on errors. In a word, it is required to seek a relation between these polynomials Λ(x), V(x) and the syndrome S₁.

Subsequently, as shown in Expression 23, when it is configured with a series polynomial having each syndrome S₁ on a coefficient of the corresponding degree, it is represented with a rational polynomial having the error quantity e_(j) of the code word symbol, the position j and the value thereof.

$\begin{matrix} {{S(x)} = {{\sum\limits_{l = 1}^{\infty}\;{S_{1}x^{1}}} = {{\sum\limits_{j = 1}^{p - 1}\;{e_{j}{\sum\limits_{l = 1}^{\infty}\;({jx})^{1}}}} = {\sum\limits_{j = 1}^{p - 1}\;{e_{j}\frac{jx}{1 - {jx}}}}}}} & \left\lbrack {{Expression}\mspace{14mu} 23} \right\rbrack \end{matrix}$ From Expression 23, a relational expression shown in Expression 24 can be established among the polynomials Λ(x), V(x) and the syndrome S(x).

$\begin{matrix} {{\left( \frac{\Lambda(x)}{V(x)} \right){S(x)}} = {- {x\left( \frac{\Lambda(x)}{V(x)} \right)}^{\prime}}} & \left\lbrack {{Expression}\mspace{14mu} 24} \right\rbrack \end{matrix}$

Subsequently, the relational expression shown in Expression 24 is used to seek the polynomials Λ(x), V(x) from the syndrome S(x).

From the syndrome S(x), a polynomial Ψ(x) with a degree of γ−1 or lower shown in Expression 25 is sought.

$\begin{matrix} {{{{\Psi(x)}{S(x)}} \equiv {{- x}\;{\Psi^{\prime}(x)}\left( {{mod}\mspace{11mu} x^{\gamma}} \right)}}{{{\Psi(x)} = {1 + {\sum\limits_{l = 1}\;{\psi_{l}x^{1}}}}},{\psi_{j} = {{- \frac{1}{j}}{\sum\limits_{i = 1}^{j}\;{\psi_{j - i}S_{i}}}}}}} & \left\lbrack {{Expression}\mspace{14mu} 25} \right\rbrack \end{matrix}$ In an expansive expression of the polynomial Ψ(x), a coefficient φ_(j) can be sought from a comparison between coefficients of the homogeneous degree on both sides of the expression shown in Expression 25 through an iterative method using the syndrome S_(i) and an already-sought coefficient ψ_(j−1). Coefficients ψ₀ to ψ_(γ−1) of the polynomial Ψ(x) are sought from syndromes S₁ to S_(γ−1). The results are shown in Expression 26.

$\begin{matrix} {{\psi_{0} = 1}{\psi_{1} = {{{- \psi_{0}}S_{1}} = {- S_{1}}}}{\psi_{2} = {{- \left( {{\psi_{1}S_{1}} + {\psi_{0}S_{2}}} \right)}/2}}\vdots{\psi_{\gamma - 1} = {{- \left( {{\psi_{\gamma - 2}S_{1}} + \ldots + {\psi_{0}S_{\gamma - 1}}} \right)}/\left( {\gamma - 1} \right)}}} & \left\lbrack {{Expression}\mspace{14mu} 26} \right\rbrack \end{matrix}$ The polynomial Ψ(x) is a polynomial equivalent to Λ(x)/V(x) while the polynomials Λ(x), V(x) are given key conditions shown in Expression 27. Therefore, it can be sought through a Euclid iterative method applied to x^(γ) and the polynomial Ψ(x) to eliminate constant multiples. V(x)Ψ(x)≡Λ(x)(mod x^(γ)) deg Λ(x)+deg V(x)<γ Λ(x) and V(x) are mutually primes deg Λ(x)−deg V(x)≡S₀(mod p)  [Expression 27]

Therefore, if the polynomial Ψ(x) can be configured from the syndromes S₁ to S_(γ−1), the syndrome S₀ can be used as a condition precedent for the iterative method to seek the polynomials Λ(x), V(x). Namely, the polynomials Λ(x), V(x) sought from the set of (S₀, Ψ(x)) through the iterative method can represent the position j and the error quantity e_(j) of an error code word symbol.

Subsequently, the Euclid iterative method is described. The following description is given to an iterative method of seeking a congruence equation, V(x)Ψ(x)≡Λ(x) (mod x^(γ)), with a condition precedent, deg Λ(x)−deg V(x)≡S₀ (mod p).

The Euclid iterative method is a method of sequentially seeking functions f₀, f₁, . . . , f_(n) using divisions of polynomials. These quantities have relations shown in Expression 28.

$\begin{matrix} {\mspace{79mu}{{{{f_{0} = {{k_{0}f_{1}} + f_{2}}},\mspace{79mu}{f_{1} = {{k_{1}f_{2}} + f_{3}}},\ldots\mspace{14mu},{f_{n} = {{k_{n}f_{n + 1}} + f_{n + 2}}}}\mspace{79mu}{{p_{- 1} = 0},{p_{0} = 1},{p_{n} = {{k_{n - 1}p_{n - 1}} + p_{n - 2}}}}\mspace{79mu}{{q_{0} = 0},{q_{1} = 1},{q_{n} = {{k_{n - 1}q_{n - 1}} + q_{n - 2}}}}\;{\begin{matrix} {\mspace{59mu}{{{p_{n}f_{n}} + {p_{n - 1}f_{n + 1}}} = {{\left( {{k_{n - 1}p_{n - 1}} + p_{n - 2}} \right)f_{n}} + {p_{n - 1}f_{n + 1}}}}} \\ {= {{p_{n - 1}\left( {{k_{n - 1}f_{n}} + f_{n + 1}} \right)} + {p_{n - 2}f_{n}}}} \\ {= {{p_{n - 1}f_{n - 1}} + {p_{n - 2}f_{n}}}} \\ {\vdots} \\ {= {{p_{0}f_{0}} + {p_{- 1}f_{1}}}} \\ {= f_{0}} \end{matrix}\begin{matrix} {{{q_{n}f_{n}} + {q_{n - 1}f_{n + 1}}} = {{\left( {{k_{n - 1}q_{n - 1}} + q_{n - 2}} \right)f_{n}} + {q_{n - 1}f_{n + 1}}}} \\ {= {{q_{n - 1}\left( {{k_{n - 1}f_{n}} + f_{n + 1}} \right)} + {q_{n - 2}f_{n}}}} \\ {= {{q_{n - 1}f_{n - 1}} + {q_{n - 2}f_{n}}}} \\ {\vdots} \\ {= {{q_{1}f_{1}} + {q_{0}f_{2}}}} \\ {= f_{1}} \end{matrix}}\mspace{79mu}{{f_{0} = {{p_{n}f_{n}} + {p_{n - 1}f_{n + 1}}}},\mspace{79mu}{f_{1} = {{q_{n}f_{n}} + {q_{n - 1}f_{n + 1}}}}}{{\begin{matrix} p_{n} & p_{n - 1} \\ q_{n} & q_{n - 1} \end{matrix}} = {{\begin{matrix} {k_{n - 1}p_{n - 1}} & p_{n - 1} \\ {k_{n - 1}q_{n - 1}} & q_{n - 1} \end{matrix}} = {\left. {- {\begin{matrix} p_{n - 1} & p_{n - 2} \\ q_{n - 1} & q_{n - 2} \end{matrix}}}\rightarrow{{p_{n}q_{n - 1}} - {p_{n - 1}q_{n}}} \right. = {{\left( {- 1} \right)^{n - 1}\left( {{p_{1}q_{0}} - {p_{0}q_{1}}} \right)} = \left( {- 1} \right)^{n}}}}}},\mspace{20mu}{f_{n} = {{\left( {- 1} \right)^{n}\left( {{q_{n - 1}f_{0}} - {p_{n - 1}f_{1}}} \right)}\therefore{f_{n} \equiv {\left( {- 1} \right)^{n + 1}p_{n - 1}\Psi\left( {{mod}\mspace{11mu} x^{\gamma}} \right)}}}},\mspace{40mu}{f_{0} = x^{\gamma}},{f_{1} = \Psi}}} & \left\lbrack {{Expression}\mspace{14mu} 28} \right\rbrack \end{matrix}$ Here, as shown in Expression 29, when p_(n) or q_(n) can be sequentially introduced from a quotient polynomial k_(n) particularly obtained through the process of division, these polynomials can satisfy a simple relation. Accordingly, f_(n) can be represented by f₀, f₁, p_(n−1) and q_(n−1). Then, when f₀=x^(γ), f₁=Ψ(x) are established to create a congruence equation at x^(γ), the iterative condition precedent turns to deg f_(n)−deg p_(n−1)≡S₀ (mod p). With regard to n that satisfies the condition precedent, if deg f_(n)+deg p_(n−1)<γ, then λ(x)=f_(n), V(x)=p_(n−1) can be established.

Subsequently, a search is made for a solution that establishes Λ(x)=0, V(x)=0.

The polynomials Λ(x), V(x) shown in Expression 22 can be turned to a polynomial shown in Expression 29 if f(x)=Λ(x) (or V(x)) is established. f(x)=1+f ₁ x+f ₂ x ² + . . . +f _(γ−1) x ^(γ−1)  [Expression 29] In solution searching, elements 1, . . . , p−1 of Zp are sequentially substituted into x of f(x) to determine x that makes f(x)=0 in relation to a modulus of p, that is, to seek a root r that establishes f(r)=0 (mod p). Once the root r is determined, an inverse element of the root r in GF(p), that is, r⁻¹ turns to the position j of the error code word symbol (j=r⁻¹), and the multiplicity e of the root r turns to the Lee metric e_(j) of the error code word symbol.

Here, searching for the multiplicity of the root r is described. In searching for the multiplicity e of the root r, first, the coefficients and binomial coefficients of the polynomials Λ(x), V(x) are used to obtain a Hasse differential polynomial shown in Expression 30.

$\begin{matrix} {\left\lbrack {f(x)} \right\rbrack^{\lbrack m\rbrack} = {\sum\limits_{i = m}^{\gamma - 1}\;{\begin{pmatrix} i \\ m \end{pmatrix}f_{i}x^{i - m}}}} & \left\lbrack {{Expression}\mspace{14mu} 30} \right\rbrack \end{matrix}$

Subsequently, a root is substituted into the Hasse differential polynomial shown in Expression 30 to find a differential rank e that does not become zero first. This rank e is the multiplicity of the root r. [f(r)]^([e−1])=0, [f(r)]^([e])≠0  [Expression 31]

Next, error correction for the code Y in the embodiment is described.

The above-described conventional method of configuring the solution searching polynomial uses the Euclid iterative method and accordingly requires divisions of polynomials, which complicate the computational process. Further, the error quantity obtained from the sought polynomial is limited to one restricted by the degree of the polynomial. Therefore, the error quantity is fixed to the polynomial obtained through the iterative method. Then, the present embodiment uses a method obtained by simplifying the method of configuring the solution searching polynomial and additionally improving the degree of freedom on error searching.

In the conventional method, the value of the syndrome S₀ is the condition precedent for seeking a solution. Therefore, depending on the situation of errors, the syndrome S₀ cannot satisfy the condition precedent and no solution may be obtained. In the present embodiment, errors caused in the code word symbols are converted in batch so that a solution can be obtained in such the situation of errors. When products are made among fixed elements in a finite field and all elements, all elements in the finite field are obtained again. This fact is used to obtain u in relation to a previously determined element η as uS₀≡η. When the error-containing code Y stored in the memory is multiplied by this u to seek syndromes, uS₀, uS₁, . . . , uS_(γ−1) are obtained as shown in Expression 32.

$\begin{matrix} {{{\sum\limits_{j = 1}^{p - 1}\;{(j)^{1}c_{j}}} = {{\sum\limits_{i = 0}^{k}\;{x^{i}{\sum\limits_{j = 0}^{p - 1}\;(j)^{1 + i}}}} = {{0\therefore{uS}_{1}} = {\sum\limits_{j = 1}^{p - 1}\;{(j)^{1}{ue}_{j}}}}}},{\eta = {{uS}_{0} = {\sum{ue}_{j}}}}} & \left\lbrack {{Expression}\mspace{14mu} 32} \right\rbrack \end{matrix}$ Here, take note that the total sum of the converted errors is η. The principle of decoding in the present embodiment has a difference in handling uE instead of the error code E from the principle of decoding in the conventional method. This difference can simplify the conventional method of seeking the polynomials Λ(x), V(x) as follows.

Hereinafter, the error correcting method in the present embedment is referred to as the “syndrome converting method”.

First, a method of introducing the polynomials Λ(x), V(x) from the syndrome S(x) is described.

With regard to configuring the polynomial Ψ(x) from the syndrome S(x), it is same in the syndrome converting method as the conventional method. It is different, though, that the syndrome to be used is uS. In a word, a polynomial Ψ(x) of the degree of γ−1 or lower can be sought in the syndrome converting method as Expression 33.

$\begin{matrix} {{{{{\Psi(x)}{S(x)}} \equiv {{- x}\;{\Psi^{\prime}(x)}\left( {{mod}\mspace{11mu} x^{\gamma}} \right)}}{\Psi(x)} = {1 + {\sum\limits_{l = 1}{\psi_{l}x^{1}}}}},{\psi_{j} = {{- \frac{1}{j}}{\sum\limits_{i = 1}^{j}\;{\psi_{j - i}{uS}_{i}}}}}} & \left\lbrack {{Expression}\mspace{14mu} 33} \right\rbrack \end{matrix}$ Therefore, when the coefficients ψ₀ to ψ_(γ−1) of the polynomial Ψ(x) are sought, the results are as shown in Expression 34.

$\begin{matrix} {{\psi_{0} = 1}{\psi_{1} = {{{- \psi_{0}}{uS}_{1}} = {- {uS}_{1}}}}{\psi_{2} = {{{- \left( {{\psi_{1}{uS}_{1}} + {\psi_{0}{uS}_{2}}} \right)}/2} = {{- {u\left( {{\psi_{1}S_{1}} + {\psi_{0}S_{2}}} \right)}}/2}}}\vdots{\psi_{\gamma - 1} = {{{- \left( {{\psi_{\gamma - 2}{uS}_{1}} + \ldots + {\psi_{0}{uS}_{\gamma - 1}}} \right)}/\left( {\gamma - 1} \right)} = {\quad{{- {u\left( {{\psi_{\gamma - 2}S_{1}} + \ldots + {\psi_{0}S_{\gamma - 1}}} \right)}}/\left( {\gamma - 1} \right)}}}}} & \left\lbrack {{Expression}\mspace{14mu} 34} \right\rbrack \end{matrix}$

The key conditions for the solution searching polynomial are shown in Expression 35. The polynomials λ(x), v(x) that can satisfy these key conditions meet the polynomials Λ(x), V(x), respectively, except the constants. V(x)Ψ(x)≡λ(x)(mod x^(γ)) deg λ(x)−deg v(x)=η=uS ₀(mod p) deg λ(x)+deg v(x)<γ  [Expression 35] As shown in Expression 35, the key conditions for the solution searching polynomial in the syndrome converting method are different from those for the conventional method in that the condition stipulated by the syndrome S₀ related to the degree is stipulated by previously determined η. Stipulation of the condition by previously determined η in this way yields deg v(x)=0 if γ−1−≦1 because the conditions related to the degree of the polynomial, deg λ(x)−deg v(x)=η, deg λ(x)+deg v(x)≦γ−1, result in 0≦2deg v(x)≦γ−1−η as can be found. Namely, when η is set within a range of γ−1≧η≧γ−2, the solution searching polynomial can be introduced without the use of the Euclid iterative method. Actually, in the case of the condition of deg Ψ(x)=η, the polynomial Ψ(x) is the only solution searching polynomial that can satisfy all the key conditions. This method corresponds to conduction of conversions to all error code word symbols to collect the positions j thereof into the collection j₊. In other word, if the total sum S₀ of errors is other than a multiple of a prime p, the total sum S₀ of errors is converted to γ−1 or γ−2 to indicate the possibility of error correction. It is the possibility to the last, however, and error correction needs conditions that all errors are collected into J₊ and the degree of the polynomial Ψ(x) sought from the syndrome uS is equal to η.

As for errors in 1 symbol, the syndrome converting method can support any errors as described later. As for errors in 2 symbols as well, it can support any errors if the syndrome S is used cyclically.

Next, in solution searching, Λ(x)=Ψ(x), V(x)=1 are established to find a solution from elements in Zp, similar to the conventional method. In the syndrome converting method, however, the multiplicity of the obtained root is in the form of the product with u. Accordingly, it is required to multiply the multiplicity by u⁻¹ to obtain errors.

In the syndrome converting method, η is set based on γ. Therefore, there are the cases of η=γ−1 and η=γ−2 though only η=γ−1 is considered in the following description.

Next, with regard to a method of converting metrics of errors to seek a solution searching polynomial, a study is made on which types of errors can be searched over the number of roots (the number of error-caused code word symbols) using the syndrome converting method.

In a first case, 1 root is obtained from the solution searching polynomial. This case is described below.

If the root is j⁻¹, then the position of the error-caused code word symbol is j, and the actual error quantity is e_(j). In this case, once multiplied by an appropriate u for conversion, the multiplicity of the root is always ue_(j)=η independent of the error quantity e_(j). Therefore, the errors in 1 symbol can be obtained completely as a solution.

In a second case, 2 roots are obtained from the solution searching polynomial. This case is described below.

If the roots are i⁻¹ and j⁻¹, then the positions of the error-caused code word symbols are i and j, and the actual error quantities are e_(i) and e_(j) (E=(0, . . . , e_(i), . . . , e_(j), . . . , 0), n=p−1). In this case, once multiplied by an appropriate u for conversion so that these can be each arranged into J₊ below p/2, a polynomial Ψ(x) shown in Expression 36 can be configured. Therefore, the error quantities can be sought from the polynomial Ψ(x). uS ₁ =i ¹ ue _(i) +j ¹ ue _(j)∴Ψ(x)=(1−ix)^(ue) ^(i) (1−jx)^(ue) ^(j)   [Expression 36] Here, once multiplied by an appropriate u for conversion of the error quantities for the purpose of arranging these into J₊, the error quantities e_(i) and e_(j) are required to have a certain relation therebetween. It is sufficient for that purpose if both are equal to each other, and this allows the conversion by u to make any error quantities reach η(η=γ−1). Therefore, the errors in 2 symbols can be obtained completely as a solution.

Next, a converting method capable of equalizing the error quantities in 2 symbols is described in detail.

The positions of error-caused 2 code word symbols in the code Y are denoted with i, j and the error quantities are denoted with e_(i), e_(j), respectively. In this case, the syndrome S₀ is represented by S₀=e_(i)+e_(j). In general, a syndrome S_(m) is represented by S_(m)=i^(m)e_(i)+j^(m)e_(j). In a word, a selection of an appropriate m can establish i^(m)e_(i)≡j^(m)e_(j).

Here, the use of the primitive root and the exponential indication of GF(p) to provide e_(i)=α^((ei)), e_(j)=α^((ej)), i=α^((i)), j=α^((j)) can establish m(i)+(e_(i))≡m(j)+(e_(j)). Therefore, m can be sought from m ≡−{(e_(j))−(e_(i))}/{(j)−(i)}.

From the above, a series of syndromes (S_(m), S_(m+1), . . . , S_(m+γ)) can be used to seek a coefficient u that establishes uS_(m)=η.

Originally, m is indistinct. Therefore, in order to support various errors in 2 code word symbols, a converting method as described below is used. Initially, m is scanned from 0 to p−2 to compute a coefficient u for each m by u=ηS_(m) ⁻¹. This allows (uS_(m), uS_(m+1), . . . , uS_(m+η)) to be sought. Next, from these (uS_(m), uS_(m+1), . . . , uS_(m+η)), a polynomial Ψ(x) is configured. Finally, m that satisfies deg Ψ(x)=ηis extracted from the configured polynomial Ψ(x). A selection of m thus extracted makes it possible to equalize the converted error quantities ue_(i), ue_(j) in 2 code word symbols.

In a third case, 3 or more roots are obtained from the solution searching polynomial. This case is described below.

When 3 or more roots are obtained from the solution searching polynomial Ψ(x), obtaining a solution requires a condition that converts the error quantities of all roots so as to belong to J₊. When this condition is provided, the polynomial Ψ(x) is configured as the η-order polynomial. When there are 3 or more roots, however, it is difficult to configure a simple converting method for supporting various errors.

Then, when there are 3 or more roots, such a converting method is used that increases the times of arranging the error quantities of all roots into J₊ after conversion. On each m for η=γ−1 and η=γ−2, this converting method applies the same converting method as that for 2 roots or less. Namely, while increasing m from 0 to p−2 in turn, the following is performed when S_(m)≠0. Initially with η=γ−1, then with η=γ−2, a coefficient q is computed in accordance with q≡ηS_(m) ⁻¹. This makes it possible to seek (qS_(m), qS_(m+1), . . . , qS_(m+γ−1)). Next, from these (qS_(m), qS_(m+1), . . . , qS_(m+γ−1)), the polynomial Ψ(x) is configured. If the polynomials Ψ(x) thus configured include a polynomial Ψ(x) that satisfies deg Ψ(x)=η, a solution can be obtained from the polynomial Λ(x). On the other hand, if all the polynomials Ψ(x) result in deg Ψ(x)≠η, the error distribution is insoluble. Therefore, the method is terminated as no solution.

The solving method includes the solving methods for 2 roots and 1 root. Thus, it is possible to seek all errors if there are 2 roots or less. On the other hand, if there are 3 roots or more, it is possible to seek errors under a special condition that, for example, the distribution of the error quantities is narrow. Specifically, if the error quantities of all errors are equal or if the error quantities of others than 1 error are equal, it is possible to seek errors in all code word symbols. In particular, if the error quantities of all error code word symbols are equal, it is possible to seek errors in the maximum η symbols.

The use of η=γ−1 and η=γ−2 can exactly increase the times of arranging the error distributions of 3 or more error code word symbols into J₊ though the types of error distributions are not clear in which a solution can be obtained. As the minimum Lee metric between code words is 2γ, it is possible to correct errors from the solution if the errors are less than γ−1.

[Application to Memory System]

Here, the above-described principle of conversion to the code C and error correction of the code Y is described on an application to an actual memory system.

Here, described is an example of the p-LM-ECC system applied to a specific memory system.

First, a relation between the number of error symbols and the error quantity in the correctable case is described. Here, described is a relation between burst errors and bit errors when memory cells store information on a bit basis.

The code C is stored as binary in memory cells and accordingly errors E in the code differ depending on the positions of error bits. The Lee metric code handles burst errors and accordingly has a restriction on errors that can be supported as bit errors. Specifically, as a data word symbol is represented by an h-bit binary, 1 bit error on the 2⁰ position has the error quantity of ±1 (1 or p−1 in Zp), and 1 bit error on the 2^(h−1) position has the error quantity of ±2^(h−1) (mod p). Therefore, in order to support the patterns of all bit errors, it is required to support all the error quantities in the code word symbols.

As described above, the use of the solution searching method of the present embodiment makes it possible to seek a solution for errors over any error quantities if the error code word symbols are 2 or below. In a word, when bit errors arise in burst, it is possible to exactly support the bursts if they are 2 or below.

The code C can be stored in memory systems configured in various manners if the code word symbols c can be binary-converted as shown in FIG. 5. In the present embodiment, however, when the characteristic of the error correcting method is taken into account, a desirable memory system is configured using memory cells capable of storing multi-values in accordance with physical quantity levels (hereinafter simply referred to as “levels”). In this case, it is possible to achieve data storage with the order of the level of a memory cell corresponding to the magnitude of the symbol value, which can decrease the error-caused fluctuations in Lee metrics. This is because mostly errors arise when they move from the correct level to the vicinity of that level.

Next, with regard to a memory system using multi-value storage memory cells, a method of assigning symbol values to levels of memory cells is described.

Memory cells such as flash memories, PRAMs, ReRAMs can store multi-values with the physical quantity levels corresponding to the quantities of data. In this case, the levels normally do not fluctuate so large and accordingly, even if errors arise, they are small errors of the several levels.

When GF(p) is used as in the present embodiment, it is convenient if the symbol value corresponds to the magnitude of the level. When 2 memory cells configure multi-levels, however, the manner of taking a representative q of Zp is considered as −2/p<q<p/2. This is because an increased prime p can reduce the proportion of a redundant symbol to the entire code and accordingly the number of levels is increased as large as possible to take a larger value of the prime p.

The following description is given to an example of the way of assigning the symbol values of −(p−1)/2 to (p−1)/2 to the levels of 2 memory cells MC1, MC2. Here, the memory cells MC1, MC2 are assumed to have 2^(h−2) levels each.

First, the way of assigning the symbol value of 0 is described.

With regard to the assignment of the symbol value of 0, the following 2 rules are determined.

(Rule 1) If the levels of the memory cells MC1, MC2 are both at the lowermost level, the symbol value is 0.

(Rule 2) If the levels of the memory cells MC1, MC2 are both at the second lowest level, the symbol value is 0.

If the symbol value is 0, it is recorded on the basis of the rule 1 as a rule while the rule 2 is also determined in consideration of the level shift caused as a result of the error occurrence.

Next, the way of assigning symbol values other than 0 is described.

The symbol values of 1 to (p−1)/2 are assigned to the second lowest level of the memory cell MC1 through the uppermost level of the memory cell MC2 as shown in FIG. 6. Take note that the uppermost level of the memory cell MC1 and the lowermost level of the memory cell MC2 are the symbol value of 2^(h−2)−1 and thus, for convenience, the same symbol value is assigned.

The symbol values of −(p−1)/2 to −1 are assigned to the second lowest level of the memory cell MC2 through the uppermost level of the memory cell MC1. This is achieved by creating negative numbers having the absolute values of the symbol values shown in FIG. 6 and exchanging the roles of the memory cells MC1, MC2.

Take note that, for convenience, the same symbol value is assigned. Take note that the uppermost level of the memory cell MC2 and the lowermost level of the memory cell MC1 are the symbol value of −2^(h−2)+1 and thus, for convenience, the same symbol value is assigned.

As described above, each level of the memory cells MC1, MC2 is assigned with 2 symbol values and accordingly the following rules are determined to take either symbol value.

(Rule 3) If the symbol values are 1 to 2^(h−2)−1, the memory cell MC2 is kept at the lowermost level. An actual symbol value is represented by the memory cell MC1.

(Rule 4) If the symbol values are 2^(h−2) to (p−1)/2, the memory cell MC2 is kept at the uppermost level. An actual symbol value is represented by the memory cell MC2.

(Rule 5) If the symbol values are −2^(h−2)+1 to −1, the memory cell MC1 is kept at the lowermost level. An actual symbol value is represented by the memory cell MC2.

(Rule 6) If the symbol values are −(p−1)/2 to −2^(h−2), the memory cell MC2 is kept at the uppermost level. An actual symbol value is represented by the memory cell MC1.

The correspondence of the level of the memory cell MC to the symbol value is actually executed in an input/output system that changes a code word symbol to a binary expression on the memory system and converts it for the correspondence of the level of the memory cell MC at a read/write circuit to the memory system.

As 2 memory cells MC1, MC2 are used, these memory cells MC1, MC2 are configured in a complementary pair of multi-values and may be used as reference memory cells mutually on reading and writing. Thus, the introduction of the way of thinking the reference level in addition to the level of the memory cell MC is not the essence of the present embodiment and the description is omitted though the association of the level of the memory cell to the symbol value can be expanded easily.

Next, based on the premise of the symbol value assignment as above, several error-occurrence patterns are verified. The errors handled herein have levels that are shifted upward or downward by one, and it is assumed that they are errors caused by code reading and writing, and due to the deterioration of the storage condition. In FIGS. 7-11, a thick solid line indicates a level in the correct condition, and a thin solid line indicates a level in the case of the error occurrence.

FIG. 7 is a diagram showing errors caused when the symbol value of 0 is recorded.

In accordance with the rule 1, the symbol value of 0 is assigned to the condition of the memory cells MC1, MC2 both at the lowermost level. Therefore, if an error occurs only in the memory cell MC1, the symbol value after the error occurrence turns to 1 as shown in the upper figure of FIG. 7. In this case, the error quantity becomes +1. If an error occurs only in the memory cell MC2, the symbol value after the error occurrence turns to −1 as shown in the upper figure of FIG. 7. In this case, the error quantity becomes −1. On the other hand, if errors occur in both the memory cells MC1, MC2, the symbol value of 0 is read in accordance with the rule 2 as shown in the lower figure of FIG. 7. From the above, the errors caused when the symbol value is 0 can fall within a range of the error quantities of ±1.

FIG. 8A is a diagram showing errors caused when a general symbol value or a symbol value of 6 is recorded.

If an error occurs only in the memory cell MC1, the symbol value after the error occurrence turns to 5 or 7. In this case, the error quantity becomes ±1. If an error occurs only in the memory cell MC2, the symbol value after the error occurrence turns to 2^(h−2) when only the memory cell MC2 is considered. As the memory cell MC1 is at the middle level, however, the symbol value indicated by the memory cell MC2 is neglected. Therefore, the symbol value becomes 6, which is indicated by the memory cell MC1. In this case, the error quantity becomes 0. Even if errors occur in both the memory cells MC1, MC2, the error quantity becomes ±1 because the symbol value of the memory cell MC2 is neglected. From the above, the errors caused when the symbol value is 6 can fall within a range of the error quantities of ±1.

FIG. 8B is a diagram showing errors caused when a general symbol value or a symbol value of −6 is recorded.

If an error occurs only in the memory cell MC2, the symbol value after the error occurrence turns to −5 or −7. In this case, the error quantity becomes ±1. If an error occurs only in the memory cell MC1, the symbol value after the error occurrence turns to −2^(h−2) when only the memory cell MC1 is considered. As the memory cell MC2 is at the middle level, however, the symbol value indicated by the memory cell MC1 is neglected. Therefore, the symbol value becomes-6, which is indicated by the memory cell MC2. In this case, the error quantity becomes 0. Even if errors occur in both the memory cells MC1, MC2, the error quantity becomes ±1 because the symbol value of the memory cell MC1 is neglected. From the above, the errors caused when the symbol value of −6 is recorded can fall within a range of the error quantities of ±1.

FIG. 9A is a diagram showing errors caused when a general symbol value or a symbol value of 2^(h−2)+4 is recorded.

If an error occurs only in the memory cell MC2, the symbol value after the error occurrence turns to 2^(h−2)+3 or 2^(h−2)+5. In this case, the error quantity becomes ±1. If an error occurs only in the memory cell MC1, the symbol value after the error occurrence turns to 2^(h−2)−2 when only the memory cell MC1 is considered. As the memory cell MC2 is at the middle level, however, the symbol value indicated by the memory cell MC1 is neglected. Therefore, the symbol value becomes 2^(h−2)+4, which is indicated by the memory cell MC2. In this case, the error quantity becomes 0. Even if errors occur in both the memory cells MC1, MC2, the error quantity becomes ±1 because the symbol value of the memory cell MC1 is neglected. From the above, the errors caused when the symbol value of 2^(h−2)+4 is recorded can fall within a range of the error quantities of ±1.

FIG. 9B is a diagram showing errors caused when a general symbol value or a symbol value of −2^(h−2)−4 is recorded.

If an error occurs only in the memory cell MC1, the symbol value after the error occurrence turns to 2^(h−2)−3 or 2^(h−2)−5. In this case, the error quantity becomes ±1. If an error occurs only in the memory cell MC2, the symbol value after the error occurrence turns to −2^(h−2)+2 when only the memory cell MC2 is considered. As the memory cell MC1 is at the middle level, however, the symbol value indicated by the memory cell MC2 is neglected. Therefore, the symbol value becomes −2^(h−2)−4, which is indicated by the memory cell MC2. In this case, the error quantity becomes 0. Even if errors occur in both the memory cells MC1, MC2, the error quantity becomes ±1 because the symbol value of the memory cell MC2 is neglected. From the above, the errors caused when the symbol value of −2^(h−2)−4 is recorded can fall within a range of the error quantities of ±1.

FIG. 10A is a diagram showing errors caused when a symbol value of 2^(h−2) assigned to the boundary between the memory cells MC1, MC2 or the vicinity is recorded.

If an error occurs only in the memory cell MC2, the symbol value after the error occurrence turns to 2^(h−2)+1 or 2^(h−2)−1. In this case, the error quantity becomes ±1. If an error occurs only in the memory cell MC1, the symbol value after the error occurrence turns to 2^(h−2)−2 when only the memory cell MC1 is considered. As the memory cell MC2 is at the middle level, however, the symbol value indicated by the memory cell MC1 is neglected. Therefore, the symbol value becomes 2^(h−2), which is indicated by the memory cell MC2. In this case, the error quantity becomes 0. On the other hand, if errors occur in both the memory cells MC1, MC2 and the memory cell MC2 is at the lowermost level, the symbol value after the error occurrence becomes 2^(h−2)−2. In this case, the error quantity becomes −2. From the above, the errors caused when the symbol value of 2^(h−2) is recorded can fall within a range of the error quantities of −2 to +1.

FIG. 10B is a diagram showing errors caused when a symbol value of −2^(h−2) assigned to the boundary between the memory cells MC1, MC2 or the vicinity is recorded.

If an error occurs only in the memory cell MC1, the symbol value after the error occurrence turns to −2^(h−2)−1or −2^(h−2)+1. In this case, the error quantity becomes ±1. If an error occurs only in the memory cell MC2, the symbol value after the error occurrence turns to −2^(h−2)+2 when only the memory cell MC2 is considered. As the memory cell MC1 is at the middle level, however, the symbol value indicated by the memory cell MC2 is neglected. Therefore, the error quantity becomes −2^(h−2), which is indicated by the memory cell MC1. In this case, the error quantity becomes 0. On the other hand, if errors occur in both the memory cells MC1, MC2 and the memory cell MC1 is at the lowermost level, the symbol value after the error occurrence becomes −2^(h−2)+2. In this case, the error quantity becomes +2. From the above, the errors caused when the symbol value of −2^(h−2) is recorded can fall within a range of the error quantities of −1 to +2.

FIG. 11A is a diagram showing errors caused when a symbol value of 2^(h−2)−2 assigned to the boundary between the memory cells MC1, MC2 or the vicinity is recorded.

If an error occurs only in the memory cell MC1, the symbol value after the error occurrence turns to 2^(h−2)−1 or 2^(h−2)−3. In this case, the error quantity becomes ±1. If an error occurs only in the memory cell MC2, the symbol value after the error occurrence turns to 2^(h−2) when only the memory cell MC2 is considered. As the memory cell MC1 is at the middle level, however, the symbol value indicated by the memory cell MC2 is neglected. Therefore, the symbol value becomes 2^(h−2)−2, which is indicated by the memory cell MC1. In this case, the error quantity becomes 0. On the other hand, if errors occur in both the memory cells MC1, MC2 and the memory cell MC1 is at the uppermost level, the symbol value after the error occurrence becomes 2^(h−2). In this case, the error quantity becomes +2. From the above, the errors caused when the symbol value of 2^(h−2)−2 is recorded can fall within a range of the error quantities of −1 to +2.

FIG. 11B is a diagram showing errors caused when a symbol value of −2^(h−2)+2 assigned to the boundary between the memory cells MC1, MC2 or the vicinity is recorded.

If an error occurs only in the memory cell MC2, the symbol value after the error occurrence turns to −2^(h−2)+1 or −2^(h−2)+3. In this case, the error quantity becomes ±1. If an error occurs only in the memory cell MC1, the symbol value after the error occurrence turns to −2^(h−2) when only the memory cell MC1 is considered. As the memory cell MC2 is at the middle level, however, the symbol value indicated by the memory cell MC1 is neglected. Therefore, the symbol value becomes −2^(h−2)+2, which is indicated by the memory cell MC2. In this case, the error quantity becomes 0. On the other hand, if errors occur in both the memory cells MC1, MC2 and the memory cell MC2 is at the uppermost level, the symbol value after the error occurrence becomes −2^(h−2). In this case, the error quantity becomes −2. From the above, the errors caused when the symbol value of −2^(h−2)+2 is recorded can fall within a range of the error quantities of −2 to +1.

Here, the assignments of the minimum value and the maximum value of the symbol values (elements of Zp) to the memory cells MC1, MC2 are mentioned. The assignments of the minimum value and the maximum value of the symbol values may become uncertain in accordance with the levels that can be set in the memory cells MC1, MC2. When the symbol values of (p−1)/2 and −(p−1)/2 are assigned to the uppermost levels of the memory cells MC1, MC2, respectively, so that the memory cells MC1, MC2 are both at the uppermost levels, it is not possible to uniquely determine if the symbol value is either of (p−1)/2 and −(p−1)/2.

Then, the symbol values of (p−1)/2, −(p−1)/2 are assigned, as shown in FIGS. 12A, 12B, independent of the number of levels of the memory cells. Namely, assignment rules of the symbol values of (p−1)/2, −(p−1)/2 are determined as follows.

(Rule 7) When the memory cells MC1, MC2 are both at the uppermost level, the maximum value of (p−1)/2 is assigned as the symbol value.

(Rule 8) When the memory cells MC1, MC2 are both at the second highest level, the minimum value of −(p−1)/2 is assigned as the symbol value.

Depending on the selection of the number of levels and the number of symbols of the memory cells MC1, MC2, the uppermost level may be assigned with no symbol value. Then, as assignment rules of the symbol values to the levels, additional rules are determined.

(Rule 9) When the level of the memory cell MC1 is at the uppermost level, and the level of the memory cell MC2 is at a level lower than the uppermost level and higher than the level assigned to the symbol value of (p−1)/2−1, the symbol value is given (p−1)/2−1.

(Rule 10) When the level of the memory cell MC2 is at the uppermost level, and the level of the memory cell MC1 is at a level lower than the uppermost level and higher than the level assigned to the symbol value of −(p−1)/2+1, the symbol value is given −(p−1)/2+1.

(Rule 11) When the memory cells MC1, MC2 are both at the third highest level, this condition is given −(p−1)/2.

The assignments of the minimum value and the maximum value of the symbol values to the levels of the memory cells MC1, MC2 in this way can prevent the minimum value and the maximum value of the symbol values from becoming uncertain.

Hereinafter, it is assumed that the memory cells MC1, MC2 have the number of levels larger than the number of symbols, and have 2 or more levels between the levels assigned to the symbol values of (p−1)/2−1 and the uppermost level, and −(p−1)/2+1 and the uppermost level.

FIG. 13A is a diagram showing errors caused when the symbol value of (p−1)/2 is recorded. When the symbol value is (p−1)/2, the memory cells MC1, MC2 are both at the uppermost level under the rule 7.

If only the memory cell MC1 suffers an error, the level of the memory cell MC1 reaches the second highest level. Therefore, the symbol value becomes −(p−1)/2+1 under the rule 10. The error quantity in this case becomes {−(p−1)/2+1}−(p−1)/2=−p+2≡2. If only the memory cell MC2 suffers an error, the level of the memory cell MC2 reaches the second highest level. Therefore, the symbol value becomes (p−1)/2−1 under the rule 9. The error quantity in this case becomes −1. If both the memory cells MC1, MC2 suffer errors, the symbol value becomes −(p−1)/2 under the rule 8. The error quantity in this case becomes −(p−1)/2−(p−1)/2=−p+1 ≡1. From the above, the errors caused when the symbol value of (p−1)/2 is recorded can fall within a range of the error quantities of −1 to +2.

FIG. 13B is a diagram showing errors caused when the symbol value of −(p−1)/2 is recorded. When the symbol value is −(p−1)/2, the memory cells MC1, MC2 are both at the second highest levels under the rule 8.

A study is made on the case where the memory cell MC1 suffers an error and reaches the uppermost level. If the memory cell MC2 suffers an error and reaches the uppermost level, the symbol value becomes (p−1)/2 under the rule 7. The error quantity in this case becomes −1. If the memory cell MC2 suffers no error, the symbol value becomes (p−1)/2−1 under the rule 9. The error quantity in this case becomes −2. If the memory cell MC2 suffers an error and reaches the third highest level, the symbol value becomes (p−1)/2−1 under the rule 9. The error quantity in this case becomes −2.

A study is made on the case where the memory cell MC1 suffers no error. If the memory cell MC2 suffers an error and reaches the uppermost level, the symbol value becomes −(p−1)/2+1 under the rule 10. The error quantity in this case becomes +1. If the memory cell MC2 suffers an error and reaches the third highest level, the symbol value becomes (p−1)/2−1. The error quantity in this case becomes −2.

A study is made on the case where the memory cell MC1 suffers an error and reaches the third highest level. If the memory cell MC2 suffers an error and reaches the uppermost level, the symbol value becomes −(p−1)/2+1. The error quantity in this case becomes +1. If the memory cell MC2 suffers no error, the symbol value becomes −(p−1)/2+1. The error quantity in this case becomes +1. If the memory cell MC2 suffers an error and reaches the third highest level, the symbol value becomes −(p−1)/2 under the rule 11. No error occurs in this case.

From the above, the errors caused when the symbol value of −(p−1)/2 is recorded can fall within a range of the error quantities of −2 to +1.

FIGS. 14A, 14B show the case where the numbers of levels of the memory cells MC1, MC2 are larger than the number of elements in Zp, and there is one level between the levels assigned to the symbol values of (p−1)/2−1, −(p−1)/2+1 and the uppermost level of the memory cells MC1, MC2.

In such the assignments, the states of errors caused when the symbol values are (p−1)/2, −(p−1)/2 are quite same as those shown in FIGS. 13A, 13B. This is because when at the uppermost levels, the symbol values become same as those shown in FIGS. 13A, 13B under the rule 11. Therefore, a study is herein made on errors that occur when the symbol values are (p−1)/2−1, −(p−1)/2+1.

FIG. 14A is a diagram showing errors caused when the symbol value of (p−1)/2−1 is recorded. When the symbol value is (p−1)/2−1, the memory cell MC1 is at the uppermost level correctly, and the memory cell MC2 is at the third highest level.

When only the memory cell MC1 suffers an error, no error occurs because the memory cell MC2 is at the middle level. On the other hand, when only the memory cell MC2 suffers an error and reaches the second highest level, the fourth highest level, the symbol values become (p−1)/2−1, (p−1)/2−2, respectively. The error quantities in this case are 0, −1, respectively.

When the memory cells MC1, MC2 both suffer errors, the symbol values become −(p−1)/2, (p−1)/2−2. The error quantities in this case are 2, −1, respectively.

From the above, the errors caused when the symbol value of (p−1)/2−1 is recorded can fall within a range of the error quantities of −1 to +2.

FIG. 14B is a diagram showing errors caused when the symbol value of −(p−1)/2+1 is recorded. When the symbol value is −(p−1)/2+1, the memory cell MC1 is at the third highest level correctly, and the memory cell MC2 is at the uppermost level.

When only the memory cell MC1 suffers an error and reaches the second highest level, the fourth highest level, the symbol values become −(p−1)/2+1, −(p−1)/2+2, respectively. The error quantities in this case are 0, +1, respectively.

When only the memory cell MC2 suffers an error, no error occurs because the memory cell MC1 is at the middle level.

When the memory cells MC1, MC2 both suffer errors, the symbol values become −(p−1)/2, (p−1)/2+2. The error quantities in this case are −1, +1, respectively.

From the above, the errors caused when the symbol value of −(p−1)/2+1 is recorded can fall within a range of the error quantities of ±1.

FIGS. 15A, 15B show the case where the numbers of levels of the memory cells MC1, MC2 meet the number of elements in Zp, and there is no useless level between the levels assigned to the symbol values of (p−1)/2−1, −(p−1)/2+1 and the uppermost level of the memory cells MC1, MC2.

In such the assignments, the states of errors caused when the symbol values of (p−1)/2, −(p−1)/2 are recorded quite same as those shown in FIGS. 13A, 13B. This is because when at the third highest levels, the symbol values become same as those shown in FIGS. 13A, 13B under the rule 11. Therefore, a study is herein made on errors that occur when the symbol values of (p−1)/2−1, −(p−1)/2+1 are recorded.

FIG. 15A is a diagram showing errors caused when the symbol value of (p−1)/2−1 is recorded. When the symbol value is (p−1)/2−1, the memory cell MC1 is at the uppermost level correctly, and the memory cell MC2 is at the second highest level.

When only the memory cell MC1 suffers an error, the symbol value becomes −(p−1)/2. The error quantity in this case is +2.

When only the memory cell MC2 suffers an error, the symbol values become (p−1)/2, (p−1)/2−2. The error quantities in this case are +1, −1, respectively.

When the memory cells MC1, MC2 both suffer errors, the symbol values become −(p−1)/2+1, (p−1)/2−2. The error quantities in this case are 3, −1, respectively.

From the above, the errors caused when the symbol value of (p−1)/2−1 is recorded can fall within a range of the error quantities of −1 to +3.

FIG. 15B is a diagram showing errors caused when the symbol value of −(p−1)/2+1 is recorded. When the symbol value is −(p−1)/2+1, the memory cell MC1 is at the second highest level correctly, and the memory cell MC2 is at the uppermost level.

When only the memory cell MC1 suffers an error, the symbol values become +(p−1)/2, −(p−1)/2+2. The error quantities in this case are −2, +1, respectively.

When only the memory cell MC2 suffers an error, the symbol value becomes −(p−1)/2. The error quantity in this case is −1.

When the memory cells MC1, MC2 both suffer errors, the symbol values become +(p−1)/2−1, −(p−1)/2+2. The error quantities in this case are −3, +1, respectively.

From the above, the errors caused when the symbol value of −(p−1)/2+1 is recorded can fall within a range of the error quantities of −3 to +1.

From the viewpoint of the above, in the example using multi-level memory cells, the error quantities are ±3 at the maximum. Therefore, the possibility of supporting the error of a Lee metric of 3 makes it possible to support level-recognition-failed errors containing failed-level-write. Further, the use of the syndrome converting method makes it possible to completely seek a solution for errors in up to 2 code word symbols. In other word, the syndrome converting method can support even if all or part of 4 memory cells configuring 2 code word symbols have failures.

Then, for the purpose of using the multi-level memory cells to store the code word symbols in this way, pieces of data input as a bit string to the memory system are assigned to levels of memory cells. Such the method is described briefly. In the method described below, the same conversion is performed as that when the code word symbols are stored as binary data in the memory system.

The pieces of data input as a binary bit string to the memory system are regarded as groups of h bits, and each group is considered a number on each digit of a 2^(h)-adic number. When the number of digits is δ, a data word D(h) is provided as shown in Expression 37 where each of d_(δ−1), d_(δ−2), . . . , d₁, d₀ is unit data composed of h bits. D(h)=d _(δ−1)(2 ^(h))^(δ−1) +d _(δ−2)(2^(h))^(δ−2) + . . . +d ₁(2^(h))¹ +d ₀(2^(h))⁰, 0<d_(δ−1)<2^(h), 0≦d_(j)<2^(h)  [Expression 37]

Subsequently, the data word D(h) shown in Expression 37 is converted to a p-adic word data D(h) as shown in Expression 38 where a_(δ), a_(δ−1), . . . , a₁, a₀ are p-adic expressed data codes X represented by the groups of h bits. D(h)=a _(δ)(p)^(δ) +a _(δ−1)(p)^(δ−1) + . . . +a ₁(p)¹ +a ₀(p)⁰, 0≦a_(j)<p, a_(δ)+a_(δ−1)≠0  [Expression 38] As described earlier, an appropriate selection of the prime p can suppress the number of digits to δ+1 at this time. When multi-level memory cells are used, the number of levels cannot be increased unnecessarily. Accordingly, the number of levels and the suitable prime p are determined previously. Additionally, a data ward D(h) suitable for the condition is determined. Namely, the number of levels of memory cells is applied to determine the number M of bits of batch-processed data. This way of determining is described later in a specific example.

Subsequently, (p−1) code word symbols are created from the data codes X and the generator matrix G to turn the input data to the code C as C=XG. Each code word symbol in the code C is stored in the memory system comprising memory cells having 2^(h−2) multi-levels by representing a representative of expression with an integer of −p/2 to p/2.

Next, a specific example is described. Among the number M of bits of the data batch-processed in the p-LM-ECC system, the number h of bits of unit data, and the maximum value ε of the sums of Lee metrics of correctable errors, a relation of p≧M/h+ε+3 can be established as described above. In addition, the prime p is selected within a range of 2^(h−1)<p<2^(h) as described above.

Then, as the number of levels of a memory cell, 8 levels can be taken per memory cell. In this case, h=5, and the candidate of the prime p is any one of 17, 19, 23, 29, 31. The method using 2 memory cells can handle 32 code word symbols. Accordingly, 31 is selected as the prime p that satisfy the condition of not exceeding 32.

If ε=2, then M≦130. As for handling data on a byte basis, when ECC processing is applied in batch to data of 128 bits corresponding to 16 bytes, M=128 makes δ=26. Therefore, the number κ of dummy symbols, of which value is given 0 inside the memory system, is derived 0 from κ=p−δ−ε−3=31−26−2−3. The number of symbols required excessively from the viewpoint of the data, that is, the number (n−δ) of redundant symbols is derived 4 from (n−δ)=p−1−δ=31−1−26. As a result, a redundancy ratio of the memory system is derived as a ratio of the number of digits of data and the number of digits increased excessively, that is, 4/26=2/13. This can be regarded as an increase ratio of memory cells required excessively to enable error correction.

For information, 2 multi-level memory cells herein described can be used to store symbols of which number is a little less than 4 times the number of levels per memory cell. This method is also effective in the case where ECC is not used. Bit data may be expressed in a p-adic number and a number on each digit may be corresponded as an element in Zp to a level. Accordingly, double the number δ of digits is almost equal to the number of multi-level memory cells capable of storing M bits. On the other hand, when the conventional method of using multi-level memory cells is used, a memory cell of 2^(h−2) levels can achieve storage of (h−2) bits. Accordingly, storage of M bits requires memory cells of which number is just M/(h−2)=hδ/(h−2)=δ(1−2/h)−1.

Therefore, in the p-LM-ECC system in the present embodiment, M bits are stored in the form of a code composed of n symbols using 2 memory cells per symbol, and accordingly 2n=2 (p−1) memory cells are required. Then, the substantial redundancy, that is, how many times the capacity of data storage are required, is given by 2(p−1)/5 (1−2/h)−1. Specifically, in the case of h=5, p=31 makes δ=26 and accordingly the substantial redundancy is 60/43=1.40. As ε=2, it is possible to correct errors in 2 pairs of memory cells at the maximum.

As the next specific example, described is the case where the number of levels per memory cell is 8 and ε is 4. In the case of this specific example, it is possible to correct errors in 4 pairs of memory cells at the maximum.

First, the redundancy ratio of the memory system according to the present embodiment in this case is shown. If h=5, then 31 may be selected as a prime p, for example. As ε=4 makes M≦120, so M=120 (15 bytes) is set, for example, as the number M of bits of batch-processed data. In this case, δ=24, and the number κ of dummy symbols is derived 0 from κ=p−δ−ε−3=31−24−4−3. Therefore, the number (n−δ) of redundant symbols is derived 6 from (n−δ)=p−1−δ=31−1−4. From the above, the redundancy ratio of the present memory system is 6/24=3/12.

Subsequently, a redundancy ratio to the conventional memory system using no ECC system is shown. In the case of the conventional memory system, the number of memory cells having the number of levels equal to 8 (3 bits) for use in 120-bit data storage is 40. In contrast, in the case of the present embodiment, the number of memory cells is 60. From the above, the redundancy ratio to the conventional memory system is 60/40=1.5.

As the next specific example, described is the case where the number of levels per memory cell is 16 and ε is 4. In the case of this specific example, it is possible to correct errors in 4 pairs of memory cells at the maximum.

First, the redundancy ratio of the memory system according to the present embodiment in this case is shown. If h=6, then 61 may be selected as a prime p, for example. As ε=4 makes M≦324, so M=324 (40.5 bytes) is set, for example, as the number M of bits of batch-processed data. In this case, δ=54, and the number κ of dummy symbols is derived 0 from κ=p−δ−ε−3=61−54−4−3. Therefore, the number (n−δ) of redundant symbols is derived 6 from (n−δ)=p−1δ=61−1−54. From the above, the redundancy ratio of the present memory system is 6/54=1/19.

Subsequently, a redundancy ratio to the conventional memory system using no ECC system is shown. In the case of the conventional memory system, the number of memory cells having the number of levels equal to 16 (4 bits) for use in 120-bit data storage is 81. In contrast, in the case of the present embodiment, the number of memory cells is 120. From the above, the redundancy ratio to the conventional memory system is 120/81≈1.48.

The redundancies in the case of storing 1 symbol in 2 multi-level memory cells have been studied through the above 3 specific examples. FIG. 16 shows a table arranging relations among the number of levels of 1 memory cell, the selected prime p, the maximum value ε of the sums of correctable Lee metrics, the minimum remedy rate, the maximum value Mmax of the numbers of bits of batch-processed data, the number M of bits of batch-processed data, the number δ of pieces of unit data, the number of memory cells required in the conventional memory system, and the redundancy to the conventional memory system. In FIG. 16, the minimum remedy rate is given 2/(p−1) because 2 code word symbols can be corrected from n=p−1 at the minimum independent of the error quantity.

As shown with underlines in FIG. 16, under the condition that the redundancy to the conventional memory system is turned to 1.5 or below, for example, ε=4 or below can be selected at the number of levels equal to 8 or higher. Though, smaller ε increases failed corrections that correct other codes as they are correct. Accordingly, it is desirable to increase ε as large as possible to the limit of the redundancy. In addition, an application to the number of levels equal to 2, that is, a single-bit memory cell is not practical as can be found from FIG. 16.

[Second Embodiment]

Next, as a second embodiment, an application to a memory system using single-level memory cells is described.

In this case, as the number of levels of memory cells causes no restriction, it is possible to increase batch-processed data and extremely lower the redundancy.

The procedure of encoding is similar to that in the case where multi-level memory cells are used, and the number M of bits of batch-processed data is determined first and then a prime p is selected.

As a specific example, a selection example on a prime p in the case of M=4096 (512 bytes) is described. Here, ε is 4. In this case, γ=ε+1=5.

First, it is assumed that the number of bits in unit data is h=8. In this case, according to the above-described selection condition on the prime p, a selection range of primes p is derived 128<p<256 from 2^(h−1)<p<2^(h). In this case, however, it is required to satisfy p≧4096/8+4+3=519 as p≧M/h+ε+3+κ and accordingly it is not possible to select a prime p.

Then, the number of bits in unit data is turned to h=9. In this case, a selection range of primes p is turned to 256<p<512 and p≧4096/9+4+3=462.1. Therefore, it is possible to select a prime p from a range of 463<p<512. Then, the minimum 467 is selected as the prime p from the primes 467, 479, 487, 491, 499, 503, 509 within the range so as to minimize the number κ of dummy symbols.

When the prime is p=467, the number of pieces of batch-processed unit data is δ=456, and the number of redundant bits is h(γ+1+κ)=9(4+2+4)=90. As a result, the redundancy of the conventional memory system using no ECC system is (4096+90)/4096=1.02, which is smaller than that in the case where multi-level memory cells are used. On the other hand, however, the minimum remedy rate is 2/466=1/233, which is around 1-digit smaller than that of multi-level memory cells.

Hereinafter, the redundancies under several condition settings in the memory cell system using single-level memory cells are evaluated.

The tables shown in FIGS. 17-22 show relations among the maximum value ε of the sums of Lee metrics of correctable errors, the number M of bits of batch-processed data, the number δ of pieces of unit data, δ+ε+3 (a selection condition of the prime p), 2^(h−1)<p<2^(h) (a selection condition of the prime p), the number κ of dummy symbols, and the number h (p−1−δ) of redundant bits indicative of the redundancy. The numbers M of bits of batch-processed data are shown as 256, 512, 1024, 2048, 4096.

As a comparison example, the number of elements in GF(2^(n)) and the number of redundant bits of the RS-ECC system using the GF(2^(n)) are shown together. The number of elements (symbols) and the number of redundant bits herein shown are computed while a group of h bits of unit data determined on the prime p is regarded as 1 symbol.

FIG. 17 provides a table in the case where errors in 2 code word symbols are made correctable (ε=2). The RS-ECC system shown in FIG. 17 is possible to correct errors in up to 2 symbols.

The selection range of primes p is limited by the number M of bits of batch-processed data. Therefore, p=53 when M=256 (32 bytes), p=79 when M=512 (64 bytes), p=137 when M=1024 (128 bytes), and p=461 when M=4096 (512 bytes). When M=2048 (256 bytes), it is not possible to select a prime p.

Errors caused in 2 code word symbols can be corrected even in the RS-ECC system of the comparison example. Therefore, if the number of redundant bits cannot be made smaller, it is useless applying the p-LM-ECC system in the present embodiment.

As shown in FIG. 17, the number of redundant bits in the p-LM-ECC system when ε=2 is not made smaller than that in the RS-ECC system. Therefore, there is no advantageous point in comparison with the RS-ECC system when ε=2.

FIG. 18 provides a table in the case where errors in 3 code word symbols are made correctable (ε=3). The RS-ECC system shown in FIG. 18 is possible to correct errors in up to 3 symbols.

The case where ε=3 is different from the case where ε=2 shown in FIG. 17 in that the prime is p=83 when M=512 (64 bytes), and the prime is p=463 when M=4096 (512 bytes).

Also in this case, the number of redundant bits is not made smaller than that in the RS-ECC system and accordingly there is no advantageous point in comparison with the RS-ECC system.

FIG. 19 provides a table in the case where errors in 4 code word symbols are made correctable (ε=4). The RS-ECC system shown in FIG. 19 is possible to correct errors in up to 4 symbols.

The case where ε=4 is different from the case where ε=3 shown in FIG. 18 in that the prime is p=467 when M=4096 (512 bytes).

Also in this case, the number of redundant bits is not made smaller than that in the RS-ECC system and accordingly there is no advantageous point in comparison with the RS-ECC system.

FIG. 20 provides a table in the case where errors in 6 code word symbols can be corrected (ε=6). The RS-ECC system shown in FIG. 20 is possible to correct errors in up to 6 symbols.

The case where ε=6 is indifferent from the case where ε=4 shown in FIG. 19 in the primes p to be selected.

When the p-LM-ECC system is used, it is advantageous because the number of redundant bits can be made smaller than that in the RS-ECC system configured to correct errors in 6 symbols. It is required, though, to consider that the p-LM-ECC system cannot correct all error patterns. If the number of error-caused symbols is 2 or less, a solution for errors can be sought completely. Further, even if the number of error-caused symbols is 3 or more, errors can be corrected if the sum of correctable Lee metrics is 6 or less. Therefore, up to the sum of error-caused symbols equal to 6, errors can be corrected to the extent. From the above point, in the case where ε=6, the application of the p-LM-ECC system is effective.

FIG. 21 provides a table in the case where errors in 7 code word symbols are made correctable (ε=7). The RS-ECC system shown in FIG. 21 is possible to correct errors in up to 7 symbols.

The case where ε=7 is different from the case where ε=6 shown in FIG. 20 in that the prime is p=59 when M=256 (32 bytes), the prime is p=89 when M=512 (64 bytes), and the prime is p=139 when M=1024 (128 bytes).

When the p-LM-ECC system is used, it is advantageous because the number of redundant bits can be made smaller than that in the RS-ECC system configured to correct errors in 7 symbols. Also in this case, it cannot support all error patterns though it is effective in that a solution for errors in up to 2 symbols can be sought completely, and that errors in 7 symbols at the maximum can be corrected.

FIG. 22 provides a table in the case where errors in 8 code word symbols are made correctable (ε=8). The RS-ECC system shown in FIG. 22 is possible to correct errors in up to 6 symbols.

The case where ε=8 is indifferent from the case where ε=7 shown in FIG. 21 in the primes p to be selected.

When the p-LM-ECC system is used, it is possible to make the number of redundant bits smaller than that in the RS-ECC system configured to correct errors in 8 symbols. Also in this case, it cannot support all error patterns though it is effective in that a solution for errors in up to 2 symbols can be sought completely, and that errors in 8 symbols at the maximum can be corrected.

As described above, the p-LM-ECC system can exert the advantage over the RS-ECC system in the following case as shown in FIGS. 17-22. In a word, if the number of bits of batch-processed data is M=4096 (512 bytes), the selectable prime is p=467 unchanged at ε=4−8, and the number of redundant bits is 90. Therefore, ε=8 is desirable. Similarly, it is possible to exert the advantage over the RS-ECC system at ε=6 when M=1024 (128 bytes), at ε=6 when M=512 (64 bytes), and at ε=6 when M=256 (32 bytes).

[Conclusion]

Here, the encoding procedure, the decoding procedure, and the system configuration of the p-LM-ECC system in the present embodiment are arranged again.

The encoding procedure is arranged using FIG. 2. In FIG. 2, the prime p that determines Zp, the number ε (=γ−1) of correctable symbols in the case where the error quantity in 1 symbol is 1, the number h of binary-expressed digits of symbols, and the number M(=δh) of bits of batch-processed data are determined previously. In addition, there are relations of n=p−1, k=n−γ.

The procedure of encoding is roughly divided into 2 stages as follows.

(Procedure 1) First, pieces of binary data fed from external to the memory system are grouped at every h bits, and converted to a 2^(h)-adic expressed δ-digit data word D(h) shown in Expression 38 (S1 in FIG. 2). D(h)=(d ₀ ,d ₁ , . . . , d _(δ−1))  [Expression 39]

Subsequently, the data word D(h) shown in Expression 39 is converted further to a p-adic expressed (δ+1)-digit data word D(h) shown in Expression 40 (S2 in FIG. 2). D(h)=(a ₀ ,a ₁ , . . . , a _(δ))  [Expression 40]

(Procedure 2) First, to the elements a₀-a_(δ) of Zp obtained through Procedure 1, only κ zeros are added to obtain k elements a₀-a_(k−1) of data D shown in Expression 41. D(h)=(a ₀ , a ₁ , . . . , a _(k−1))  [Expression 41] Subsequently, this data D is multiplied by a generator matrix G to obtain n code word symbols c₁-c_(n) of a code C (S3 in FIG. 2). The value of each code word symbol is as shown in Expression 42.

$\begin{matrix} {c_{j} = {\sum\limits_{i = 0}^{k - 1}\;{(j)^{i + 1}a_{i}}}} & \left\lbrack {{Expression}\mspace{14mu} 42} \right\rbrack \end{matrix}$

Finally, the code word symbols c_(j) are stored in memory cells (S4 in FIG. 2).

The decoding procedure is arranged using FIGS. 3A, 3B.

The procedure of decoding is roughly divided to 7 procedures as follows. Hereinafter, the procedure numbers are serial numbers containing the procedure of encoding. Take note that Procedures 3 and 4 shown below are repeated over the elements (m=0 to p−2) of Zp.

(Procedure 3) A code Y read out of memory cells is read out (S5 in FIG. 3A). The code Y is configured as shown in Expression 43. Here, e_(j) denotes an error in the code word symbol at the position j of the code Y. Y=(y ₁ ,y ₂ , . . . , y _(n)) Y=C+E, E=(e ₁ , e ₂ , . . . , e _(n))  [Expression 43]

Subsequently, the values y_(j) (j=1 to n) of n code word symbols contained in the code Y are multiplied by j^(m) to compute j^(m)y_(j) as numbers of Zp. The symbol value y_(j) can be sought from the level in the case of the multi-level memory cell. In the case of a general binary memory, it is a number obtained from binary data. The code Y is multiplied by a transpose of a syndrome matrix H to obtain a syndrome series S (=YH^(T)) composed of syndromes S_(m) to S_(m+ε) as shown in Expression 44 (S6 in FIG. 3A).

$\begin{matrix} {{S = \left( {S_{m},S_{m + 1},\ldots\mspace{14mu},S_{m + ɛ}} \right)},{S_{1} = {{\sum\limits_{j = 1}^{p - 1}\;{(j)^{1}y_{j}}} = {\sum\limits_{j = 1}^{p - 1}\;{(j)^{1}e_{j}}}}}} & \left\lbrack {{Expression}\mspace{14mu} 44} \right\rbrack \end{matrix}$

(Procedure 4) First, with regard to the upper limit ε (=γ−1) of the number of correctable symbols, q=εS_(m) ⁻¹ is computed to obtain qS_(m) to qS_(m+ε) from the syndrome S₁ obtained through Procedure 3. Subsequently, coefficients ψ_(j) of a solution searching polynomial Ψ(x) shown in Expression 45 are computed sequentially from qS_(m) to qS_(m+ε) (S7 in FIG. 3A).

$\begin{matrix} {{{\Psi(x)} = {1 + {\sum\limits_{l = 1}^{\gamma - 1}\;{\psi_{l}x^{1}}}}},{\psi_{j} = {{- j^{- 1}}{\sum\limits_{i = 1}^{j}\;{\psi_{j - i}{qS}_{m + i}}}}}} & \left\lbrack {{Expression}\mspace{14mu} 45} \right\rbrack \end{matrix}$ Here, if the coefficient of x^(ε) is ψ_(ε)≠0, then the process goes to Procedure 5 to obtain a solution. On the other hand, if ψ_(ε)=0, the process is terminated as no solution. Otherwise, in order to further search the possibility of correction, η=ε−1 is used to compute q=ηS_(m) ⁻¹, then Procedure 4 is repeated. If the coefficient of x^(η) is ψ_(η)≠0, then the process goes to Procedure 5 to obtain a solution. On the other hand, if ψ_(η)=0, the process is terminated as no solution. If the process cannot be performed in Procedure 4, the error correction is interrupted as no solution because the error distribution is not supportable.

(Procedure 5) If it is found that no solution can be obtained as a result of ψ_(ε)≠0 in Procedure 4, a solution is obtained in Procedures 5, 6. First, in Procedure 5, in order to obtain the multiplicity of the solution, a Hasse differential polynomial [Ψ(x)]^([i]) shown in Expression 46 is sought. The coefficients ψ_(j) obtained through Procedure 4 are multiplied by a series of binomial coefficients to obtain coefficients of the Hasse differential polynomial (S9 in FIG. 3A).

$\begin{matrix} {{\left\lbrack {\Psi(x)} \right\rbrack^{\lbrack i\rbrack} = {\sum\limits_{j = 1}\;{\begin{pmatrix} j \\ i \end{pmatrix}\psi_{j}x^{j - i}}}},{\Psi^{\lbrack i\rbrack} = \left\{ {{\begin{pmatrix} i \\ i \end{pmatrix}\psi_{i}},{\begin{pmatrix} {i + 1} \\ i \end{pmatrix}\psi_{i + 1}},{\begin{pmatrix} {i + 2} \\ i \end{pmatrix}\psi_{i + 2}},\ldots} \right\}}} & \left\lbrack {{Expression}\mspace{14mu} 46} \right\rbrack \end{matrix}$

(Procedure 6) The elements 1 to p−1 of Zp are substituted into the resultant Hasse differential polynomial to seek all the elements r that can make the O-order differential polynomial (=Ψ(x)) be equal to zero. Subsequently, as shown in Expression 47, such the degree n is sought that makes the (n−1)-order differential polynomial be equal to zero over each r but the n-order differential polynomial be not equal to zero (S10 in FIG. 3B).

$\begin{matrix} {{\left\lbrack {\Psi(r)} \right\rbrack^{\lbrack 0\rbrack} = {{\Psi(r)} = 0}},{\left\lbrack {\Psi(r)} \right\rbrack^{\lbrack{n - 1}\rbrack} = {{\sum\limits_{j = {n - 1}}\;{\begin{pmatrix} j \\ {n - 1} \end{pmatrix}\Psi_{j}r^{j - n + 1}}} = 0}},{\left\lbrack {\Psi(r)} \right\rbrack^{\lbrack n\rbrack} = {{\sum\limits_{j = n}\;{\begin{pmatrix} j \\ n \end{pmatrix}\psi_{j}r^{j - n}}} \neq 0}}} & \left\lbrack {{Expression}\mspace{14mu} 47} \right\rbrack \end{matrix}$

The obtained r is an inverse element of the position of the code word symbol in the error-caused code, and the corresponding n is the quantity converted from the caused error quantity.

(Procedure 7) In Procedure 7, the error quantity is sought through a conversion from the multiplicity n of the solution. The position of the error-caused code word symbol is t=r⁻¹, and the reverse conversion of the conversion performed to obtain the polynomial for obtaining a solution is applied to n. As there is a relation of qt^(m)e_(t)=n, the original error quantity e_(t) can be derived from n as e_(t)=(qt^(m))⁻¹n. The error quantity e_(t) is subtracted from the symbol value y_(t) of the code Y read out of memory cells to obtain the symbol value c_(t) of the corrected code C (S11 in FIG. 3B).

Up to now, as the correct code C stored in the memory system is obtained, the binary data input to the memory system is sought through Procedures 8 and 9.

(Procedure 8) From the code C error-corrected through Procedure 7 and the generator matrix G, k elements a₀ to a_(k−1) of GF(p) are sought via a multi-variable system of linear equations XG=C. Among those, κ elements are dummy elements (0). Accordingly, substantially (δ+1) elements a₀ to a_(δ) of GF(p) can be obtained. From the obtained elements a₀ to a_(δ), (δ+1)-digit p-adic expressed data word D(h) is created (S12 in FIG. 3B).

(Procedure 9) Finally, the data word D(h) is converted to a δ-digit binary-expression to bring a numeral on each digit to a binary expression. Thus, the restoration of binary data fed to the memory system is completed (S13 in FIG. 3B).

Next, the configuration of the memory system is arranged using FIG. 1.

The memory system comprises the memory unit 100 and the p-LM-ECC system 200 as roughly divided.

The binary-expressed data D fed from external is supplied to the p-adic number converter unit 201. The p-adic number converter unit converts the data D to a δ-digit p-adic expressed data word D(h).

The data word D(h) output from the p-adic number converter unit 201 is supplied to the encoder unit 202. The encoder unit 202 exerts the generator matrix G on the data word D(h) to create the code C composed of the elements of GF(p). The code C output from the encoder unit 202 is fed to and stored in the memory unit 100 including flash memories, PRAMs, ReRAMs and so forth.

The code Y (error-containing code C) read out of the memory unit 100 is fed to the syndrome generator unit 203. The syndrome generator unit 203 makes m=0 and additionally performs the process of multiplying the code Y by the syndrome H and an m-th power of the number indicative of the position of the code word symbol of the code Y read out of the memory unit 100 to create the syndrome S using a diagonal matrix. If the syndrome S is equal to zero, the code contains no error. Accordingly, the code Y is processed as the code C as it is in the decoder unit 207. On the other hand, if the syndrome S is not equal to zero, the process goes to the solution searching polynomial generator unit 204 for error correction.

The solution searching polynomial generator unit 204 generates a solution searching polynomial Ψ(x) from the syndrome S output from the syndrome generator unit 203. If the coefficient on the degree at the η (=γ−1)-order thereof is not equal to zero, the process goes to the Hasse differential polynomial generator unit 205 for searching a solution. On the other hand, if the coefficient on the degree at the n-order is equal to zero, the process goes to the solution searching polynomial generator unit 204 again to search a solution searching polynomial Ψ(x) for a new n obtained by subtracting 1 from η, as required. Even though, if the coefficient at the η-order is still equal to zero, the process goes to the syndrome generator unit 203 to search a new syndrome S after further adding 1 to m. The series of processes is repeated until the coefficient at the η-order of the solution searching polynomial Ψ(x) reaches zero. If the coefficient at the η-order of the solution searching polynomial Ψ(x) is still equal to zero even after the process is repeated up to η=γ−2, m=p−2, error correction is impossible. Therefore, an error signal NG is provided to external. Even if error correction is possible, an inconsistent code may be obtained after a series of processes is repeated over all m to seek a corrected code. This case can be decided as failed correction and regarded as the so-called list error correction that contains the correct code in the obtained codes.

The Hasse differential polynomial generator unit 205 derives a Hasse differential polynomial from the solution searching polynomial Ψ(x) of which coefficient at the n-order is non-zero and extracts the root r thereof and the multiplicity of the root from GF(p).

The code restorer unit 206 uses the root r extracted at the Hasse differential polynomial generator unit 205 to seek the position of an error symbol in the code Y from t=r⁻¹ and uses the multiplicity n to seek the error quantity e_(t). This result is applied to restore the code C.

The code C restored at the code restorer unit 206 is supplied to the decoder unit 207. The decoder unit 207 reverse-converts the generator matrix G over the code C to regenerate the p-adic expressed data word D(h).

The p-adic expressed data word D(h) regenerated at the decoder unit is supplied to the binary converter unit 208. The binary converter unit 208 converts the p-adic expressed data word D(h) to a 2^(h)-adic expressed data word D(h) to generate binary data D. Finally, the binary data D is provided to external as read data.

FIG. 1 shows the case where the p-LM-ECC system is contained inside the memory system though the p-LM-ECC system may be located outside the memory system.

Finally, the error correction ability of the syndrome converting method applied in the memory system according to the embodiment is described again. Here, a study is made on the error correction ability of the p-LM-ECC system capable of correcting 4 symbols at the maximum in comparison with the RS-ECC system capable of correcting 2 symbols and the 2^(n)-BCH-ECC system capable of correcting 4 random bit errors.

FIG. 23 provides a table arranging OK/NG of error correction by these 3 ECC systems. A square in the “error” row of the table images a symbol, and a black dot located inside the square images an error-caused bit. For information, 1 symbol includes 8 bits.

When the RS-ECC system is used, any errors can be corrected up to 2 symbols. As shown in FIG. 23, however, even if the number of error bits is smaller, they cannot be corrected entirely if they distribute over 3 or more symbols.

When the 2^(n)-BCH-ECC system is used, any errors caused can be corrected up to 4 bits. If there are 5-bit errors or more, the errors cannot be corrected even if they can be contained in 1 symbol.

When the p-LM-ECC system according to the embodiment is used, any errors can be corrected if they can be contained in 2 symbols. Further, even errors spreading over 3 or more symbols, 4 symbols can be corrected at the maximum if the error contents are analogous among symbols. In the case of the p-LM-ECC system, errors distributing over 4 symbols cannot be corrected completely though it is effective because the redundancy is lower than the RS-ECC system.

As obvious from the above, the RS-ECC system is strong in correction of burst errors while it is weak in correction of random errors. In addition, the 2^(n)-BCH-ECC system is strong in correction of random errors while it is weak in correction of burst errors. Therefore, in the RS-ECC system and the 2^(n)-BCH-ECC system, it is difficult to support the case where random errors and burst errors occur frequently due to fine fabrication of the memory system. With this regard, the p-LM-ECC system according to the embodiment can support such random errors and burst errors and accordingly it is optimal to fine-fabricated memory systems.

[Others]

While certain embodiments have been described, these embodiments have been presented by way of example only, and are not intended to limit the scope of the inventions. Indeed, the novel methods and systems described herein may be embodied in a variety of other forms: furthermore, various omissions, substitutions and changes in the form of the methods and systems described herein may be made without departing from the spirit of the inventions. The accompanying claims and their equivalents are intended to cover such forms or modifications as would fall within the scope and spirit of the inventions.

The embodiments described above are applicable to memory systems using memory cells having 3 or more levels. For example, they are applicable to memory systems using flash memories, DRAMs, PRAMs, ReRAMs and so forth. 

What is claimed is:
 1. A memory system, comprising: a p-adic number converter unit operative to divide batch-processed binary data D into δ-digit (δ is an integer), h-bit (h is an integer) symbols and convert the symbols to a k-digit (k is an integer), p-adic data word (p is a prime of 3 or more); an encoder unit operative to generate, from said data word p-adic converted at said p-adic number converter unit, a code C composed of a residual field Zp of the prime p, of n-digit (n=p−1) code words having numbers on digits each indicated by h bits; a memory unit operative to store the code C of Zp generated at said encoder unit as write data; an error correcting unit operative to generate, from read data Y read out from said memory unit, a syndrome S and apply an operation using said generated syndrome S for error correcting said read data Y to regenerate the code C of Zp; a decoder unit operative to reverse-convert the code C of Zp regenerated at said error correcting unit to regenerate the p-adic data word; and a binary converter unit operative to convert the data word regenerated at said decoder unit to a binary number to regenerate the binary data D.
 2. The memory system according to claim 1, wherein said memory unit has a plurality of memory cells capable of setting at least 2^(h−2)-stage physical quantity levels, wherein said memory unit, (1) when both 2 memory cells are set to a physical quantity level near the minimum, makes data correspond to 0, (2) when both 2 memory cells are set to a physical quantity level near the maximum, makes data correspond to −(p−1)/2 or (p−1)/2, (3) when one memory cell of 2 memory cells is set to the minimum physical quantity level, makes the physical quantity level of the other memory cell correspond to data of −1 to −2^(h−2)+1, (4) when the other memory cell of 2 memory cells is set to the minimum physical quantity level, makes the physical quantity level of the one memory cell correspond to data of 1 to 2^(h−2)−1, (5) when the one memory cell of 2 memory cells is set to the maximum physical quantity level, makes the physical quantity level of the other memory cell correspond to data of 2^(h−2) to (p−1)/2−1, and (6) when the other memory cell of 2 memory cells is set to the maximum physical quantity level, makes the physical quantity level of the one memory cell correspond to data of −2^(h−2) to −(p−1)/2+1.
 3. The memory system according to claim 1, wherein said error correcting unit uses ε=γ−1 to denote the maximum value of the sums of Lee metrics of correctable errors, seeks u for a previously determined element η=uS₀ on components S₀, S₁, . . . , S_(γ−1) of said syndrome S to generate a new syndrome S in accordance with S=uS₀, uS₁, . . . , uS_(γ−1) and generates a polynomial Ψ(x) in accordance with ${{\Psi(x)} = {1 + {\sum\limits_{l = 1}^{ɛ}\;{\Psi_{l}x^{1}}}}},{\Psi_{j} = {{- j^{- 1}}{\sum\limits_{i = 1}^{j}\;{\Psi_{j - i}{uS}_{i}}}}}$ for use in said operation.
 4. The memory system according to claim 1, wherein if 2^(h−)≦n≦2(2^(h−1)−1), and ε denotes the maximum value of the sums of Lee metrics of correctable errors, there is a relation of δ+ε+2+κ=n (κ=an integer of 0 to 10).
 5. The memory system according to claim 1, wherein there is a relation of 2^(h−1)<p<2^(h).
 6. The memory system according to claim 1, wherein said error correcting unit includes a syndrome generator unit operative to generate said syndrome S from said read data Y, a solution searching polynomial generator unit operative to derive coefficients of a solution searching polynomial Ψ(x) from said syndrome S to generate said solution searching polynomial Ψ(x), a Hasse differential polynomial generator unit operative to generate a Hasse differential polynomial [Ψ(x)] from said solution searching polynomial Ψ(x) to extract the root r of said Hasse differential polynomial [Ψ(x)] and the multiplicity of the root r, and a code restorer unit operative to derive the position of the error in the data Y and the error quantity from the root r and the multiplicity of the root r to regenerate said code C.
 7. The memory system according to claim 2, wherein said memory unit, (7) when both 2 memory cells are set to the maximum physical quantity level, makes data correspond to data of (p−1)/2, and (8) when both 2 memory cells are set to a physical quantity level near the maximum below the maximum physical quantity level, makes data correspond to data of −(p−1)/2.
 8. The memory system according to claim 7, wherein said memory unit, (9) when the one memory cell of 2 memory cells is set to the maximum physical quantity level, makes the physical quantity level near the maximum below the maximum physical quantity level of the other memory cell correspond to data of (p−1)/2−1, and (10) when the other memory cell of 2 memory cells is set to the maximum physical quantity level, makes the physical quantity level near the maximum below the maximum physical quantity level of the one memory cell correspond to data −(p−1)/2+1.
 9. A method of data writing and reading in memory systems, comprising: dividing batch-processed binary data D into δ-digit (δ is an integer), h-bit (h is an integer) symbols and converting the symbols to a k-digit (k is an integer), p-adic data word (p is a prime of 3 or more); generating, from said p-adic converted data word, a code C composed of a residual field Zp of the prime p, of n-digit (n=p−1) code words having numbers on digits each indicated by h bits; storing the generated code C of Zp in a memory unit as write data; generating, from read data Y read out from said memory unit, a syndrome S and applying an operation using said generated syndrome S for error correcting said read data Y to regenerate the code C of Zp; reverse-converting the regenerated code C of Zp to regenerate the p-adic data word; and converting the regenerated data word to a binary number to regenerate the binary data D.
 10. The method of data writing and reading in memory systems according to claim 9, wherein the step of applying said operation using said syndrome S for error correcting said read data Y includes using ε=γ−1 to denote the maximum value of the sums of Lee metrics of correctable errors, seeking u for a previously determined element η=uS₀ on components S₀, S₁, . . . , S_(γ−1) of said syndrome S to generate a new syndrome S in accordance with S=uS₀,uS₁, . . . , uS_(γ−1) and generating a polynomial Ψ(x) in accordance with ${{\Psi(x)} = {1 + {\sum\limits_{l = 1}^{ɛ}\;{\Psi_{l}x^{1}}}}},{\Psi_{j} = {{- j^{- 1}}{\sum\limits_{i = 1}^{j}\;{\Psi_{j - i}{uS}_{i}}}}}$ for use in said operation.
 11. The method of data writing and reading in memory systems according to claim 9, wherein if 2^(h−1)≦n≦2(2^(h−1)−1), and εdenotes the maximum value of the sums of Lee metrics of correctable errors, there is a relation of δ+ε+2+κ=n (κ=an integer of 0 to 10).
 12. A memory system, comprising: a p-adic number converter unit operative to divide batch-processed binary data D into δ-digit (δ is an integer), h-bit (h is an integer) symbols and convert the symbols to a k-digit (k is an integer), p-adic data word (p is an integer of 3 or more); an encoder unit operative to generate, from said data word p-adic converted at said p-adic number converter unit, a code C composed of n-digit (n=p−1) code words having numbers on digits each indicated by h bits; a memory unit having a plurality of memory cells, capable of setting p-stage physical quantity levels with at least one or plural memory cells, and operative to store the code C generated at said encoder unit, said numbers on digits of said h-bit code words, as write data in accordance with said physical quantity levels; an error correcting unit operative to error-correct, from read data Y read out from said memory unit, said numbers on digits of said h-bit code words; a decoder unit operative to reverse-convert the code C error-corrected at said error correcting unit to regenerate the p-adic data word; and a binary converter unit operative to convert the data word regenerated at said decoder unit to a binary number to regenerate the binary data D.
 13. The memory system according to claim 12, wherein said memory unit has a plurality of memory cells capable of setting at least 2^(h−2)-stage physical quantity levels, wherein said memory unit, (1) when both 2 memory cells are set to a physical quantity level near the minimum, makes data correspond to 0, (2) when both 2 memory cells are set to a physical quantity level near the maximum, makes data correspond to −(p−1)/2 or (p−1)/2, (3) when one memory cell of 2 memory cells is set to the minimum physical quantity level, makes the physical quantity level of the other memory cell correspond to data of −1 to −2^(h−2)+1, (4) when the other memory cell of 2 memory cells is set to the minimum physical quantity level, makes the physical quantity level of the one memory cell correspond to data of 1 to 2^(h−2)−1, (5) when the one memory cell of 2 memory cells is set to the maximum physical quantity level, makes the physical quantity level of the other memory cell correspond to data of 2^(h−2) to (p−1)/2−1, and (6) when the other memory cell of 2 memory cells is set to the maximum physical quantity level, makes the physical quantity level of the one memory cell correspond to data of −2^(h−2) to −(p−1)/2+1.
 14. The memory system according to claim 12, wherein said error correcting unit uses ε=γ−1 to denote the maximum value of the sums of Lee metrics of correctable errors, seeks u for a previously determined element η=uS₀ on components S₀, S₁, . . . , S_(γ−1) of said syndrome S to generate a new syndrome S in accordance with S=uS₀,uS₁, . . . , uS_(γ−1) and generates a polynomial Ψ(x) in accordance with ${{\Psi(x)} = {1 + {\sum\limits_{l = 1}^{ɛ}\;{\Psi_{l}x^{1}}}}},{\Psi_{j} = {{- j^{- 1}}{\sum\limits_{i = 1}^{j}\;{\Psi_{j - i}{uS}_{i}}}}}$ for use in said operation.
 15. The memory system according to claim 12, wherein if 2^(h−1)≦n≦2(2^(h−1)−1), and ε denotes the maximum value of the sums of Lee metrics of correctable errors, there is a relation of δ+ε+2+κ=n (κ=an integer of 0 to 10).
 16. The memory system according to claim 12, wherein said error correcting unit includes a syndrome generator unit operative to generate said syndrome S from said read data Y, a solution searching polynomial generator unit operative to derive coefficients of a solution searching polynomial Ψ(x) from said syndrome S to generate said solution searching polynomial Ψ(x), a Hasse differential polynomial generator unit operative to generate a Hasse differential polynomial [Ψ(x)] from said solution searching polynomial Ψ(x) to extract the root r of said Hasse differential polynomial [Ψ(x)] and the multiplicity of the root r, and a code restorer unit operative to derive the position of the error in the data Y and the error quantity from the root r and the multiplicity of the root r to regenerate said code C.
 17. The memory system according to claim 13, wherein said memory unit, (7) when both 2 memory cells are set to the maximum physical quantity level, makes data correspond to data of (p−1)/2, and (8) when both 2 memory cells are set to a physical quantity level near the maximum below the maximum physical quantity level, makes data correspond to data of −(p−1)/2.
 18. The memory system according to claim 17, wherein said memory unit, (9) when the one memory cell of 2 memory cells is set to the maximum physical quantity level, makes the physical quantity level near the maximum below the maximum physical quantity level of the other memory cell correspond to data of (p−1)/2−1, and (10) when the other memory cell of 2 memory cells is set to the maximum physical quantity level, makes the physical quantity level near the maximum below the maximum physical quantity level of the one memory cell correspond to data −(p−1)/2+1. 